1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -05:00

SystemClock for calendar overview

This commit is contained in:
bbedward
2025-09-11 22:34:22 -04:00
parent 5b49e36da4
commit 7a671b586c

View File

@@ -1,5 +1,6 @@
import QtQuick import QtQuick
import QtQuick.Effects import QtQuick.Effects
import Quickshell
import qs.Common import qs.Common
import qs.Services import qs.Services
import qs.Widgets import qs.Widgets
@@ -8,7 +9,7 @@ Rectangle {
id: root id: root
property bool showEventDetails: false property bool showEventDetails: false
property date selectedDate: new Date() property date selectedDate: systemClock.date
property var selectedDateEvents: [] property var selectedDateEvents: []
property bool hasEvents: selectedDateEvents && selectedDateEvents.length > 0 property bool hasEvents: selectedDateEvents && selectedDateEvents.length > 0
@@ -222,8 +223,8 @@ Rectangle {
id: calendarGrid id: calendarGrid
visible: !showEventDetails visible: !showEventDetails
property date displayDate: new Date() property date displayDate: systemClock.date
property date selectedDate: new Date() property date selectedDate: systemClock.date
readonly property date firstDay: { readonly property date firstDay: {
const date = new Date(displayDate.getFullYear(), displayDate.getMonth(), 1) const date = new Date(displayDate.getFullYear(), displayDate.getMonth(), 1)
@@ -420,4 +421,9 @@ Rectangle {
} }
} }
} }
SystemClock {
id: systemClock
precision: SystemClock.Hours
}
} }