fix: #1859 dayjs locale translation (#1868)

This commit is contained in:
Manuel
2024-02-03 16:38:56 +01:00
committed by GitHub
parent a6ea9ac333
commit 824f4b8acc
2 changed files with 35 additions and 4 deletions

View File

@@ -58,8 +58,8 @@ function App(
const analyticsEnabled = pageProps.analyticsEnabled ?? true;
// TODO: make mapping from our locales to moment locales
const language = getLanguageByCode(pageProps.session?.user?.language ?? 'en');
if (language.locale !== 'cr') require(`dayjs/locale/${language.locale}.js`);
dayjs.locale(language.locale);
if (language.dayJsLocale) require(`dayjs/locale/${language.dayJsLocale}.js`);
dayjs.locale(language.dayJsLocale);
const [primaryColor, setPrimaryColor] = useState<MantineTheme['primaryColor']>(
props.pageProps.primaryColor ?? 'red'