fix the problem that the day of week in date time / date range picker is wrong
This commit is contained in:
@@ -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');
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user