Dynamic import of dayjs locale
This commit is contained in:
parent
a1677094f7
commit
6ed9c1e226
2 changed files with 10 additions and 12 deletions
|
|
@ -77,8 +77,7 @@ const Event = (props) => {
|
|||
|
||||
useEffect(() => {
|
||||
if (Array.from(supportedLocales).includes(i18n.language)) {
|
||||
require(`dayjs/locale/${i18n.language}`);
|
||||
dayjs.locale(i18n.language);
|
||||
import(`dayjs/locale/${i18n.language}.js`).then(() => dayjs.locale(i18n.language));
|
||||
}
|
||||
}, [i18n.language]);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue