[bug] add luxon locale fallback

This commit is contained in:
Andrea Vos 2022-12-27 12:08:07 +01:00
parent 309fb276fe
commit f56e90698f

View File

@ -59,7 +59,12 @@ export default ({ app, store }) => {
return promise; return promise;
}; };
Settings.defaultLocale = config.locale; try {
Settings.defaultLocale = config.locale;
DateTime.now().toFormat('y-MM-dd HH:mm'); // test if locale is supported by luxon
} catch {
Settings.defaultLocale = 'en';
}
Vue.prototype.$datetime = (timestamp) => { Vue.prototype.$datetime = (timestamp) => {
const dt = DateTime.fromSeconds(timestamp); const dt = DateTime.fromSeconds(timestamp);