How to use locales with module / TypeScript? #2669
-
I am trying to set a datepicker's locale in a TypeScript environment. I have tried this in the official REPL updating TD to the latest version, but it does not seem to work: import { TempusDominus, loadLocale } from '@eonasdan/tempus-dominus';
import { localization, name } from "@eonasdan/tempus-dominus/dist/locales/it";
loadLocale(localization);
let dp = new TempusDominus(document.getElementById('datetimepicker1'));
dp.locale(name); Note that I had to import from dist because I could not find the locales in the typings (for reference, here is how dayjs handles this). Am I missing something? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi. I just updated the docs on how to load these with TS. Let me know if you need more help. |
Beta Was this translation helpful? Give feedback.
Hi. I just updated the docs on how to load these with TS. Let me know if you need more help.