fix AM/PM text in datetime picker is not translated

This commit is contained in:
MaysWind
2023-08-19 22:37:26 +08:00
parent 3095613a76
commit 7257abefb4
6 changed files with 15 additions and 6 deletions
@@ -37,6 +37,9 @@
<template #month-overlay-value="{ text }">
{{ getMonthShortName(text) }}
</template>
<template #am-pm-button="{ toggle, value }">
<button class="dp__pm_am_button" tabindex="0" @click="toggle">{{ $t(`datetime.${value}.content`) }}</button>
</template>
</vue-date-picker>
</v-card-text>
<v-card-text class="overflow-y-visible">
@@ -34,6 +34,9 @@
<template #month-overlay-value="{ text }">
{{ getMonthShortName(text) }}
</template>
<template #am-pm-button="{ toggle, value }">
<button class="dp__pm_am_button" tabindex="0" @click="toggle">{{ $t(`datetime.${value}.content`) }}</button>
</template>
</vue-date-picker>
<f7-button large fill
:class="{ 'disabled': !dateRange[0] || !dateRange[1] }"
@@ -29,6 +29,9 @@
<template #month-overlay-value="{ text }">
{{ getMonthShortName(text) }}
</template>
<template #am-pm-button="{ toggle, value }">
<button class="dp__pm_am_button" tabindex="0" @click="toggle">{{ $t(`datetime.${value}.content`) }}</button>
</template>
</vue-date-picker>
</f7-page-content>
</f7-sheet>
+2 -2
View File
@@ -1079,9 +1079,9 @@ function setLanguage(i18nGlobal, locale, force) {
weekdaysMin : getAllMinWeekdayNames(i18nGlobal.t),
meridiem: function (hours) {
if (hours > 11) {
return i18nGlobal.t('datetime.PM.upperCase');
return i18nGlobal.t('datetime.PM.content');
} else {
return i18nGlobal.t('datetime.AM.upperCase');
return i18nGlobal.t('datetime.AM.content');
}
}
});
+2 -2
View File
@@ -81,10 +81,10 @@ export default {
},
'datetime': {
'AM': {
'upperCase': 'AM'
'content': 'AM'
},
'PM': {
'upperCase': 'PM'
'content': 'PM'
},
'Monday': {
'min': 'Mo',
+2 -2
View File
@@ -81,10 +81,10 @@ export default {
},
'datetime': {
'AM': {
'upperCase': '上午'
'content': '上午'
},
'PM': {
'upperCase': '下午'
'content': '下午'
},
'Monday': {
'min': '一',