fix: specify date time format for every lang, closes #1387

This commit is contained in:
MiniDigger | Martin 2024-07-22 20:21:39 +02:00
parent 017e3d2505
commit b2047fe274

View File

@ -1,37 +1,69 @@
const dateTimeFormat = {
date: {
day: "numeric",
month: "long",
year: "numeric",
},
time: {
day: "numeric",
month: "2-digit",
year: "numeric",
hour: "numeric",
minute: "numeric",
},
datetime: {
day: "numeric",
month: "long",
year: "numeric",
hour: "numeric",
minute: "numeric",
},
shortweektime: {
weekday: "short",
hour: "numeric",
minute: "numeric",
},
clock: {
hour: "numeric",
minute: "numeric",
},
} as const;
export default defineI18nConfig(() => ({
legacy: false,
locale: "en",
fallbackLocale: "en",
datetimeFormats: {
en: {
date: {
day: "numeric",
month: "long",
year: "numeric",
},
time: {
day: "numeric",
month: "2-digit",
year: "numeric",
hour: "numeric",
minute: "numeric",
},
datetime: {
day: "numeric",
month: "long",
year: "numeric",
hour: "numeric",
minute: "numeric",
},
shortweektime: {
weekday: "short",
hour: "numeric",
minute: "numeric",
},
clock: {
hour: "numeric",
minute: "numeric",
},
},
af: dateTimeFormat,
ar: dateTimeFormat,
bg: dateTimeFormat,
ca: dateTimeFormat,
cs: dateTimeFormat,
da: dateTimeFormat,
de: dateTimeFormat,
dum: dateTimeFormat,
el: dateTimeFormat,
en: dateTimeFormat,
es: dateTimeFormat,
fi: dateTimeFormat,
fr: dateTimeFormat,
he: dateTimeFormat,
hu: dateTimeFormat,
it: dateTimeFormat,
ja: dateTimeFormat,
ko: dateTimeFormat,
ku: dateTimeFormat,
nl: dateTimeFormat,
no: dateTimeFormat,
pl: dateTimeFormat,
pt: dateTimeFormat,
ro: dateTimeFormat,
ru: dateTimeFormat,
srcyrl: dateTimeFormat,
sv: dateTimeFormat,
tr: dateTimeFormat,
uk: dateTimeFormat,
zhS: dateTimeFormat,
zhT: dateTimeFormat,
},
}));