From 84048f600965bacdaf9657377d55b0c6f85258d5 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Sat, 4 Aug 2018 15:51:51 +0200 Subject: Use full date to check for today --- views/calendar/qml/WeekView.qml | 6 ++++-- 1 file 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 { function roundToDay(date) { return new Date(date.getFullYear(), date.getMonth(), date.getDate()) } + property bool isInPast: roundToDay(root.currentDate) > roundToDay(dayDelegate.date) + property bool isToday: roundToDay(root.currentDate).getTime() == roundToDay(dayDelegate.date).getTime() //Dimm days in the past Rectangle { anchors.fill: parent color: Kube.Colors.buttonColor opacity: 0.2 - visible: roundToDay(root.currentDate) > roundToDay(dayDelegate.date) + visible: isInPast } //Grid @@ -298,7 +300,7 @@ FocusScope { y: root.hourHeight * root.currentDate.getHours() + root.hourHeight / 60 * root.currentDate.getMinutes() height: 2 color: Kube.Colors.plasmaBlue - visible: root.currentDate.getDate() == dayDelegate.date.getDate() + visible: isToday opacity: 0.8 } -- cgit v1.2.3