summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Mollekopf <chrigi_1@fastmail.fm>2018-08-04 15:51:51 +0200
committerChristian Mollekopf <chrigi_1@fastmail.fm>2018-08-04 15:51:51 +0200
commit84048f600965bacdaf9657377d55b0c6f85258d5 (patch)
treeab68b24cebdcc3e26be50ee36500258cefc053a1
parent0b5f790868449db960263214b6ea5d81dbfc3a4b (diff)
downloadkube-84048f600965bacdaf9657377d55b0c6f85258d5.tar.gz
kube-84048f600965bacdaf9657377d55b0c6f85258d5.zip
Use full date to check for today
-rw-r--r--views/calendar/qml/WeekView.qml6
1 files changed, 4 insertions, 2 deletions
diff --git a/views/calendar/qml/WeekView.qml b/views/calendar/qml/WeekView.qml
index c9717241..980ec432 100644
--- a/views/calendar/qml/WeekView.qml
+++ b/views/calendar/qml/WeekView.qml
@@ -198,13 +198,15 @@ FocusScope {
198 function roundToDay(date) { 198 function roundToDay(date) {
199 return new Date(date.getFullYear(), date.getMonth(), date.getDate()) 199 return new Date(date.getFullYear(), date.getMonth(), date.getDate())
200 } 200 }
201 property bool isInPast: roundToDay(root.currentDate) > roundToDay(dayDelegate.date)
202 property bool isToday: roundToDay(root.currentDate).getTime() == roundToDay(dayDelegate.date).getTime()
201 203
202 //Dimm days in the past 204 //Dimm days in the past
203 Rectangle { 205 Rectangle {
204 anchors.fill: parent 206 anchors.fill: parent
205 color: Kube.Colors.buttonColor 207 color: Kube.Colors.buttonColor
206 opacity: 0.2 208 opacity: 0.2
207 visible: roundToDay(root.currentDate) > roundToDay(dayDelegate.date) 209 visible: isInPast
208 } 210 }
209 211
210 //Grid 212 //Grid
@@ -298,7 +300,7 @@ FocusScope {
298 y: root.hourHeight * root.currentDate.getHours() + root.hourHeight / 60 * root.currentDate.getMinutes() 300 y: root.hourHeight * root.currentDate.getHours() + root.hourHeight / 60 * root.currentDate.getMinutes()
299 height: 2 301 height: 2
300 color: Kube.Colors.plasmaBlue 302 color: Kube.Colors.plasmaBlue
301 visible: root.currentDate.getDate() == dayDelegate.date.getDate() 303 visible: isToday
302 opacity: 0.8 304 opacity: 0.8
303 } 305 }
304 306