diff --git a/src/components/mobile/DateRangeSelectionSheet.vue b/src/components/mobile/DateRangeSelectionSheet.vue index 0d69af74..a141172a 100644 --- a/src/components/mobile/DateRangeSelectionSheet.vue +++ b/src/components/mobile/DateRangeSelectionSheet.vue @@ -91,7 +91,7 @@ export default { return this.$store.getters.currentUserFirstDayOfWeek; }, dayNames() { - return this.$locale.getAllMinWeekdayNames(); + return this.$utilities.arrangeArrayWithNewStartIndex(this.$locale.getAllMinWeekdayNames(), this.firstDayOfWeek); }, is24Hour() { const datetimeFormat = this.$t('format.datetime.long'); diff --git a/src/components/mobile/DateTimeSelectionSheet.vue b/src/components/mobile/DateTimeSelectionSheet.vue index fa77e523..5a64db85 100644 --- a/src/components/mobile/DateTimeSelectionSheet.vue +++ b/src/components/mobile/DateTimeSelectionSheet.vue @@ -66,7 +66,7 @@ export default { return this.$store.getters.currentUserFirstDayOfWeek; }, dayNames() { - return this.$locale.getAllMinWeekdayNames(); + return this.$utilities.arrangeArrayWithNewStartIndex(this.$locale.getAllMinWeekdayNames(), this.firstDayOfWeek); }, is24Hour() { const datetimeFormat = this.$t('format.datetime.long'); diff --git a/src/lib/utils.js b/src/lib/utils.js index b360990c..893b7112 100644 --- a/src/lib/utils.js +++ b/src/lib/utils.js @@ -462,6 +462,24 @@ function copyArrayTo(fromArray, toArray) { return toArray; } +function arrangeArrayWithNewStartIndex(array, startIndex) { + if (startIndex <= 0 || startIndex >= array.length) { + return array; + } + + const newArray = []; + + for (let i = startIndex; i < array.length; i++) { + newArray.push(array[i]); + } + + for (let i = 0; i < startIndex; i++) { + newArray.push(array[i]); + } + + return newArray; +} + function appendThousandsSeparator(value) { if (!settings.isEnableThousandsSeparator() || value.length <= 3) { return value; @@ -927,6 +945,7 @@ export default { isDateRangeMatchFullMonths, copyObjectTo, copyArrayTo, + arrangeArrayWithNewStartIndex, appendThousandsSeparator, numericCurrencyToString, stringCurrencyToNumeric,