the order of year and month in the date picker is based on the order in long date format set by the user

This commit is contained in:
MaysWind
2024-03-09 21:51:23 +08:00
parent 8c83af1543
commit 802cdabd75
6 changed files with 42 additions and 9 deletions
@@ -27,6 +27,7 @@
:week-start="firstDayOfWeek"
:year-range="yearRange"
:day-names="dayNames"
:year-first="isYearFirst"
:is24="is24Hour"
:partial-range="false"
:preset-dates="presetRanges"
@@ -130,6 +131,9 @@ export default {
dayNames() {
return arrangeArrayWithNewStartIndex(this.$locale.getAllMinWeekdayNames(), this.firstDayOfWeek);
},
isYearFirst() {
return this.$locale.isLongDateMonthAfterYear(this.userStore);
},
is24Hour() {
return this.$locale.isLongTime24HourFormat(this.userStore);
},
+4 -3
View File
@@ -20,6 +20,7 @@
:week-start="firstDayOfWeek"
:year-range="yearRange"
:day-names="dayNames"
:year-first="isYearFirst"
:is24="is24Hour"
v-model="dateTime">
<template #month="{ text }">
@@ -98,6 +99,9 @@ export default {
dayNames() {
return arrangeArrayWithNewStartIndex(this.$locale.getAllMinWeekdayNames(), this.firstDayOfWeek);
},
isYearFirst() {
return this.$locale.isLongDateMonthAfterYear(this.userStore);
},
is24Hour() {
return this.$locale.isLongTime24HourFormat(this.userStore);
},
@@ -113,9 +117,6 @@ export default {
};
},
methods: {
setCurrentTime() {
this.dateTime = getLocalDatetimeFromUnixTime(getCurrentUnixTime())
},
getMonthShortName(month) {
return this.$locale.getMonthShortName(month);
}
@@ -24,6 +24,7 @@
:week-start="firstDayOfWeek"
:year-range="yearRange"
:day-names="dayNames"
:year-first="isYearFirst"
:is24="is24Hour"
:partial-range="false"
:preset-dates="presetRanges"
@@ -118,6 +119,9 @@ export default {
dayNames() {
return arrangeArrayWithNewStartIndex(this.$locale.getAllMinWeekdayNames(), this.firstDayOfWeek);
},
isYearFirst() {
return this.$locale.isLongDateMonthAfterYear(this.userStore);
},
is24Hour() {
return this.$locale.isLongTime24HourFormat(this.userStore);
},
@@ -22,6 +22,7 @@
:week-start="firstDayOfWeek"
:year-range="yearRange"
:day-names="dayNames"
:year-first="isYearFirst"
v-model="dateTime">
<template #month="{ text }">
{{ getMonthShortName(text) }}
@@ -99,6 +100,9 @@ export default {
},
dayNames() {
return arrangeArrayWithNewStartIndex(this.$locale.getAllMinWeekdayNames(), this.firstDayOfWeek);
},
isYearFirst() {
return this.$locale.isLongDateMonthAfterYear(this.userStore);
}
},
beforeUnmount() {