summaryrefslogtreecommitdiff
path: root/src/controls
diff options
context:
space:
mode:
Diffstat (limited to 'src/controls')
-rw-r--r--src/controls/Private/CalendarHeaderModel.qml7
-rw-r--r--src/controls/Styles/Base/CalendarStyle.qml1
2 files changed, 6 insertions, 2 deletions
diff --git a/src/controls/Private/CalendarHeaderModel.qml b/src/controls/Private/CalendarHeaderModel.qml
index b978dbdc..40328a8b 100644
--- a/src/controls/Private/CalendarHeaderModel.qml
+++ b/src/controls/Private/CalendarHeaderModel.qml
@@ -89,7 +89,10 @@ ListModel {
dayOfWeek: Locale.Saturday
}
- Component.onCompleted: {
+ Component.onCompleted: updateFirstDayOfWeek()
+ onLocaleChanged: updateFirstDayOfWeek()
+
+ function updateFirstDayOfWeek() {
var daysOfWeek = [Locale.Sunday, Locale.Monday, Locale.Tuesday,
Locale.Wednesday, Locale.Thursday, Locale.Friday, Locale.Saturday];
var firstDayOfWeek = root.locale.firstDayOfWeek;
@@ -97,7 +100,7 @@ ListModel {
var shifted = daysOfWeek.splice(firstDayOfWeek, daysOfWeek.length - firstDayOfWeek);
daysOfWeek = shifted.concat(daysOfWeek)
- if (firstDayOfWeek !== Locale.Sunday) {
+ if (firstDayOfWeek !== root.get(0).dayOfWeek) {
for (var i = 0; i < daysOfWeek.length; ++i) {
root.setProperty(i, "dayOfWeek", daysOfWeek[i]);
}
diff --git a/src/controls/Styles/Base/CalendarStyle.qml b/src/controls/Styles/Base/CalendarStyle.qml
index 20459274..ef0cb779 100644
--- a/src/controls/Styles/Base/CalendarStyle.qml
+++ b/src/controls/Styles/Base/CalendarStyle.qml
@@ -410,6 +410,7 @@ Style {
anchors.leftMargin: (control.weekNumbersVisible ? weekNumbersItem.width : 0)
anchors.right: parent.right
spacing: gridVisible ? __gridLineWidth : 0
+ property alias __repeater: repeater
Repeater {
id: repeater