Et2Date: Avoid error localizing English

This commit is contained in:
nathan 2022-04-29 09:11:11 -06:00
parent ef7c175814
commit e5f238584e

View File

@ -17,11 +17,14 @@ import {dateStyles} from "./DateStyles";
import {LitFlatpickr} from "lit-flatpickr";
import "flatpickr/dist/plugins/scrollPlugin.js";
if(egw.preference('lang') && egw.preference('lang') !== "en")
{
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