diff options
Diffstat (limited to 'views/calendar/qml/WeekView.qml')
-rw-r--r-- | views/calendar/qml/WeekView.qml | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/views/calendar/qml/WeekView.qml b/views/calendar/qml/WeekView.qml index 73436bc9..fb49e8e0 100644 --- a/views/calendar/qml/WeekView.qml +++ b/views/calendar/qml/WeekView.qml | |||
@@ -48,12 +48,6 @@ FocusScope { | |||
48 | 48 | ||
49 | property date startDate: getMonday(currentDate) | 49 | property date startDate: getMonday(currentDate) |
50 | 50 | ||
51 | function addDaysToDate(date, days) { | ||
52 | var date = new Date(date); | ||
53 | date.setDate(date.getDate() + days); | ||
54 | return date; | ||
55 | } | ||
56 | |||
57 | Item { | 51 | Item { |
58 | anchors { | 52 | anchors { |
59 | top: parent.top | 53 | top: parent.top |
@@ -74,14 +68,17 @@ FocusScope { | |||
74 | width: root.dayWidth * root.daysToShow | 68 | width: root.dayWidth * root.daysToShow |
75 | Repeater { | 69 | Repeater { |
76 | model: root.daysToShow | 70 | model: root.daysToShow |
77 | 71 | delegate: Item { | |
78 | delegate: Rectangle { | ||
79 | width: root.dayWidth | 72 | width: root.dayWidth |
80 | height: Kube.Units.gridUnit + Kube.Units.smallSpacing * 3 | 73 | height: Kube.Units.gridUnit + Kube.Units.smallSpacing * 3 |
81 | |||
82 | color: "yellow" | ||
83 | |||
84 | Kube.Label { | 74 | Kube.Label { |
75 | function addDaysToDate(date, days) { | ||
76 | var date = new Date(date); | ||
77 | date.setDate(date.getDate() + days); | ||
78 | return date; | ||
79 | } | ||
80 | font.bold: true | ||
81 | |||
85 | anchors.centerIn: parent | 82 | anchors.centerIn: parent |
86 | text: addDaysToDate(root.startDate, modelData).toLocaleString(Qt.locale(), "dddd") | 83 | text: addDaysToDate(root.startDate, modelData).toLocaleString(Qt.locale(), "dddd") |
87 | } | 84 | } |