Fix dynamic import of datefns with downcase locale
Closes #1215 Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
f531c39b7e
commit
8eb949af60
|
@ -5,10 +5,9 @@ export const dateFnsPlugin = {
|
||||||
install(app: App, options: { locale: string }) {
|
install(app: App, options: { locale: string }) {
|
||||||
function dateFnsfileForLanguage(lang: string) {
|
function dateFnsfileForLanguage(lang: string) {
|
||||||
const matches: Record<string, string> = {
|
const matches: Record<string, string> = {
|
||||||
en_US: "en-US",
|
|
||||||
en: "en-US",
|
en: "en-US",
|
||||||
};
|
};
|
||||||
return matches[lang] ?? lang;
|
return matches[lang] ?? lang.replace("_", "-");
|
||||||
}
|
}
|
||||||
|
|
||||||
import(
|
import(
|
||||||
|
|
|
@ -70,7 +70,7 @@
|
||||||
class="datepicker starts-on"
|
class="datepicker starts-on"
|
||||||
:placeholder="t('Type or select a date…')"
|
:placeholder="t('Type or select a date…')"
|
||||||
icon="calendar-today"
|
icon="calendar-today"
|
||||||
:locale="$i18n.locale"
|
:locale="$i18n.locale.replace('_', '-')"
|
||||||
v-model="beginsOn"
|
v-model="beginsOn"
|
||||||
horizontal-time-picker
|
horizontal-time-picker
|
||||||
editable
|
editable
|
||||||
|
@ -90,7 +90,7 @@
|
||||||
class="datepicker ends-on"
|
class="datepicker ends-on"
|
||||||
:placeholder="t('Type or select a date…')"
|
:placeholder="t('Type or select a date…')"
|
||||||
icon="calendar-today"
|
icon="calendar-today"
|
||||||
:locale="$i18n.locale"
|
:locale="$i18n.locale.replace('_', '-')"
|
||||||
v-model="endsOn"
|
v-model="endsOn"
|
||||||
horizontal-time-picker
|
horizontal-time-picker
|
||||||
:min-datetime="beginsOn"
|
:min-datetime="beginsOn"
|
||||||
|
|
Loading…
Reference in a new issue