From e5f238584e3a5007a70811eb2884fc050e7e3083 Mon Sep 17 00:00:00 2001 From: nathan Date: Fri, 29 Apr 2022 09:11:11 -0600 Subject: [PATCH] Et2Date: Avoid error localizing English --- api/js/etemplate/Et2Date/Et2Date.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/api/js/etemplate/Et2Date/Et2Date.ts b/api/js/etemplate/Et2Date/Et2Date.ts index cce4e1ee57..6560650b22 100644 --- a/api/js/etemplate/Et2Date/Et2Date.ts +++ b/api/js/etemplate/Et2Date/Et2Date.ts @@ -17,11 +17,14 @@ import {dateStyles} from "./DateStyles"; import {LitFlatpickr} from "lit-flatpickr"; import "flatpickr/dist/plugins/scrollPlugin.js"; -import(egw.webserverUrl + "/node_modules/flatpickr/dist/l10n/" + (egw.preference('lang') + ".js")).then(() => +if(egw.preference('lang') && egw.preference('lang') !== "en") { - // @ts-ignore - flatpickr.localize(flatpickr.l10ns[egw.preference('lang')]); -}); + import(egw.webserverUrl + "/node_modules/flatpickr/dist/l10n/" + (egw.preference('lang') + ".js")).then(() => + { + // @ts-ignore + flatpickr.localize(flatpickr.l10ns[egw.preference('lang')]); + }); +} /** * Parse a date string into a Date object