diff options
Diffstat (limited to 'views/calendar/qml/WeekView.qml')
-rw-r--r-- | views/calendar/qml/WeekView.qml | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/views/calendar/qml/WeekView.qml b/views/calendar/qml/WeekView.qml index 484a151f..c9717241 100644 --- a/views/calendar/qml/WeekView.qml +++ b/views/calendar/qml/WeekView.qml | |||
@@ -29,25 +29,7 @@ FocusScope { | |||
29 | property var dayWidth: (root.width - Kube.Units.gridUnit - Kube.Units.largeSpacing * 2) / root.daysToShow | 29 | property var dayWidth: (root.width - Kube.Units.gridUnit - Kube.Units.largeSpacing * 2) / root.daysToShow |
30 | property var hourHeight: Kube.Units.gridUnit * 2 | 30 | property var hourHeight: Kube.Units.gridUnit * 2 |
31 | property date currentDate | 31 | property date currentDate |
32 | 32 | property date startDate: currentDate | |
33 | function getFirstDayOfWeek(date) { | ||
34 | var firstDay = Qt.locale().firstDayOfWeek | ||
35 | var year = date.getFullYear() | ||
36 | var month = date.getMonth() | ||
37 | //Jup, getDate returns the day of the month | ||
38 | var day = date.getDate() | ||
39 | |||
40 | while (true) { | ||
41 | if (date.getDay() === firstDay) { | ||
42 | return date | ||
43 | } | ||
44 | day = day - 1 | ||
45 | date = new Date(year, month, day) | ||
46 | } | ||
47 | return date | ||
48 | } | ||
49 | |||
50 | property date startDate: getFirstDayOfWeek(currentDate) | ||
51 | 33 | ||
52 | Item { | 34 | Item { |
53 | anchors { | 35 | anchors { |