diff --git a/aleksis/core/assets/app.js b/aleksis/core/assets/app.js index 3fda256d7740305515809b037d1868d4e7792305..dafceaa5e5aae60dcf917c1ab6378554003e3eda 100644 --- a/aleksis/core/assets/app.js +++ b/aleksis/core/assets/app.js @@ -10,6 +10,7 @@ import "./css/global.scss"; import VueI18n from "vue-i18n"; import messages from "./messages.json"; +import dateTimeFormats from "./dateTimeFormats.js"; Vue.use(VueI18n); @@ -17,6 +18,7 @@ const i18n = new VueI18n({ locale: "en", fallbackLocale: "en", messages, + dateTimeFormats }); // Using this function, apps can register their locale files diff --git a/aleksis/core/assets/dateTimeFormats.js b/aleksis/core/assets/dateTimeFormats.js new file mode 100644 index 0000000000000000000000000000000000000000..03d6b60af218fca1e6a86caa0bc458464a2cd47a --- /dev/null +++ b/aleksis/core/assets/dateTimeFormats.js @@ -0,0 +1,24 @@ +const dateTimeFormats = { + en: { + short: { + year: "numeric", month: "short", day: "numeric" + }, + long: { + year: "numeric", month: "long", day: "numeric", weekday: "long", hour: "numeric", minute: "numeric" + }, + timeOnly: { + hour: "numeric", minute: "numeric", second: "numeric" + } + }, de: { + short: { + year: "numeric", month: "short", day: "numeric" + }, long: { + year: "numeric", month: "long", day: "numeric", weekday: "long", hour: "numeric", minute: "numeric" + }, + timeOnly: { + hour: "numeric", minute: "numeric", second: "numeric" + } + } +} + +export default dateTimeFormats;