1 import setDefaultOptions from "date-fns/setDefaultOptions";
2 import { I18NextService } from "../../services";
6 export default async function () {
7 let lang = I18NextService.i18n.language;
12 // if lang and country are the same, then date-fns expects only the lang
13 // eg: instead of "fr-FR", we should import just "fr"
15 if (lang.includes("-")) {
16 const parts = lang.split("-");
17 if (parts[0] === parts[1].toLowerCase()) {
27 /* webpackExclude: /\.js\.flow$/ */
28 `date-fns/locale/${lang}`
33 `Could not load locale ${lang} from date-fns, falling back to ${EN_US}`,
37 /* webpackExclude: /\.js\.flow$/ */
38 `date-fns/locale/${EN_US}`