Skip to content

Commit

Permalink
🐛 fix: fix dayjs render on server (#3278)
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx authored Jul 21, 2024
1 parent 7506b70 commit 8c08dd5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/layout/GlobalProvider/Locale.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ const Locale = memo<LocaleLayoutProps>(({ children, defaultLang, antdLocale }) =
i18n.init();

// load the dayjs locale
if (lang) {
const dayJSLocale = require(`dayjs/locale/${lang!.toLowerCase()}.js`);

dayjs.locale(dayJSLocale);
}
// if (lang) {
// const dayJSLocale = require(`dayjs/locale/${lang!.toLowerCase()}.js`);
//
// dayjs.locale(dayJSLocale);
// }
} else {
// if on browser side, init i18n instance only once
if (!i18n.instance.isInitialized)
Expand Down

0 comments on commit 8c08dd5

Please sign in to comment.