From f56e90698f3be53fb2c157e46663b0d46fee8da8 Mon Sep 17 00:00:00 2001 From: Andrea Vos Date: Tue, 27 Dec 2022 12:08:07 +0100 Subject: [PATCH] [bug] add luxon locale fallback --- plugins/globals.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/globals.js b/plugins/globals.js index 6ca80be23..025190f66 100644 --- a/plugins/globals.js +++ b/plugins/globals.js @@ -59,7 +59,12 @@ export default ({ app, store }) => { 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) => { const dt = DateTime.fromSeconds(timestamp);