mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-24 13:32:50 -05:00
SystemClock for calendar overview
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import QtQuick
|
||||
import QtQuick.Effects
|
||||
import Quickshell
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
@@ -8,7 +9,7 @@ Rectangle {
|
||||
id: root
|
||||
|
||||
property bool showEventDetails: false
|
||||
property date selectedDate: new Date()
|
||||
property date selectedDate: systemClock.date
|
||||
property var selectedDateEvents: []
|
||||
property bool hasEvents: selectedDateEvents && selectedDateEvents.length > 0
|
||||
|
||||
@@ -222,8 +223,8 @@ Rectangle {
|
||||
id: calendarGrid
|
||||
visible: !showEventDetails
|
||||
|
||||
property date displayDate: new Date()
|
||||
property date selectedDate: new Date()
|
||||
property date displayDate: systemClock.date
|
||||
property date selectedDate: systemClock.date
|
||||
|
||||
readonly property date firstDay: {
|
||||
const date = new Date(displayDate.getFullYear(), displayDate.getMonth(), 1)
|
||||
@@ -420,4 +421,9 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SystemClock {
|
||||
id: systemClock
|
||||
precision: SystemClock.Hours
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user