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

17
src/lib/dayjs/Setup.ts Normal file
View File

@@ -0,0 +1,17 @@
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import dayjs from 'dayjs';
import customParseFormat from 'dayjs/plugin/customParseFormat';
import { loadDayJsLocale } from '@/util/language.tsx';
dayjs.extend(customParseFormat);
loadDayJsLocale(navigator.language).then(() => {
dayjs.locale(navigator.language);
});