summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--views/calendar/qml/WeekView.qml7
1 files changed, 4 insertions, 3 deletions
diff --git a/views/calendar/qml/WeekView.qml b/views/calendar/qml/WeekView.qml
index ba9b24d2..f78a4a8d 100644
--- a/views/calendar/qml/WeekView.qml
+++ b/views/calendar/qml/WeekView.qml
@@ -30,14 +30,15 @@ FocusScope {
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
33 function getMonday(date) { 33 function getFirstDayOfWeek(date) {
34 var firstDay = Qt.locale().firstDayOfWeek
34 var year = date.getFullYear() 35 var year = date.getFullYear()
35 var month = date.getMonth() 36 var month = date.getMonth()
36 //Jup, getDate returns the day of the month 37 //Jup, getDate returns the day of the month
37 var day = date.getDate() 38 var day = date.getDate()
38 39
39 while (true) { 40 while (true) {
40 if (date.getDay() === Locale.Monday) { 41 if (date.getDay() === firstDay) {
41 return date 42 return date
42 } 43 }
43 day = day - 1 44 day = day - 1
@@ -46,7 +47,7 @@ FocusScope {
46 return date 47 return date
47 } 48 }
48 49
49 property date startDate: getMonday(currentDate) 50 property date startDate: getFirstDayOfWeek(currentDate)
50 51
51 Item { 52 Item {
52 anchors { 53 anchors {