From 8e2c52911ce2879166b4444fd5e821cb25b80fff Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Mon, 20 Aug 2018 09:19:19 +0200 Subject: Display day number --- views/calendar/qml/DayLabels.qml | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/views/calendar/qml/DayLabels.qml b/views/calendar/qml/DayLabels.qml index cd961068..391f3b0e 100644 --- a/views/calendar/qml/DayLabels.qml +++ b/views/calendar/qml/DayLabels.qml @@ -36,16 +36,25 @@ Row { delegate: Item { width: root.dayWidth height: Kube.Units.gridUnit + Kube.Units.smallSpacing * 3 - Kube.Label { - function addDaysToDate(date, days) { - var date = new Date(date); - date.setDate(date.getDate() + days); - return date; - } - font.bold: true - + function addDaysToDate(date, days) { + var date = new Date(date); + date.setDate(date.getDate() + days); + return date; + } + property date day: addDaysToDate(root.startDate, modelData) + Column { anchors.centerIn: parent - text: addDaysToDate(root.startDate, modelData).toLocaleString(Qt.locale(), "dddd") + Kube.Label { + anchors.horizontalCenter: parent.horizontalCenter + font.bold: true + text: day.toLocaleString(Qt.locale(), "dddd") + } + Kube.Label { + anchors.horizontalCenter: parent.horizontalCenter + text: day.toLocaleString(Qt.locale(), "d") + color: Kube.Colors.disabledTextColor + font.pointSize: Kube.Units.tinyFontSize + } } } } -- cgit v1.2.3