Extract dayjs setup into file

This commit is contained in:
schroda
2024-05-21 20:45:13 +02:00
parent d889be558e
commit 09ee5e6862
2 changed files with 18 additions and 9 deletions

View File

@@ -8,20 +8,12 @@
import { StrictMode } from 'react';
import { createRoot } from 'react-dom/client';
import dayjs from 'dayjs';
import customParseFormat from 'dayjs/plugin/customParseFormat';
import { App } from '@/App';
import '@/index.css';
// roboto font
import '@fontsource/roboto';
import { defaultPromiseErrorHandler } from '@/util/defaultPromiseErrorHandler.ts';
import { loadDayJsLocale } from '@/util/language.tsx';
dayjs.extend(customParseFormat);
loadDayJsLocale(navigator.language).then(() => {
dayjs.locale(navigator.language);
});
import '@/lib/dayjs/Setup.ts';
if ('serviceWorker' in navigator) {
navigator.serviceWorker.ready.then((registration) => {