(Hopefully_ fix datefn localization issues

This commit is contained in:
SleeplessOne1917 2023-06-25 15:12:43 -04:00
parent 0866296f2c
commit 6cbc18df20
4 changed files with 1 additions and 26 deletions

View file

@ -1,4 +1,4 @@
import { initializeSite, setupDateFns } from "@utils/app"; import { initializeSite } from "@utils/app";
import { hydrate } from "inferno-hydrate"; import { hydrate } from "inferno-hydrate";
import { Router } from "inferno-router"; import { Router } from "inferno-router";
import { App } from "../shared/components/app/app"; import { App } from "../shared/components/app/app";
@ -10,8 +10,6 @@ import "bootstrap/js/dist/dropdown";
async function startClient() { async function startClient() {
initializeSite(window.isoData.site_res); initializeSite(window.isoData.site_res);
await setupDateFns();
const wrapper = ( const wrapper = (
<Router history={HistoryService.history}> <Router history={HistoryService.history}>
<App /> <App />

View file

@ -1,4 +1,3 @@
import { setupDateFns } from "@utils/app";
import express from "express"; import express from "express";
import path from "path"; import path from "path";
import process from "process"; import process from "process";
@ -32,7 +31,6 @@ server.get("/css/themelist", ThemesListHandler);
server.get("/*", CatchAllHandler); server.get("/*", CatchAllHandler);
server.listen(Number(port), hostname, () => { server.listen(Number(port), hostname, () => {
setupDateFns();
console.log(`http://${hostname}:${port}`); console.log(`http://${hostname}:${port}`);
}); });

View file

@ -46,7 +46,6 @@ import searchCommentTree from "./search-comment-tree";
import selectableLanguages from "./selectable-languages"; import selectableLanguages from "./selectable-languages";
import setIsoData from "./set-iso-data"; import setIsoData from "./set-iso-data";
import setTheme from "./set-theme"; import setTheme from "./set-theme";
import setupDateFns from "./setup-date-fns";
import showAvatars from "./show-avatars"; import showAvatars from "./show-avatars";
import showLocal from "./show-local"; import showLocal from "./show-local";
import showScores from "./show-scores"; import showScores from "./show-scores";
@ -105,7 +104,6 @@ export {
selectableLanguages, selectableLanguages,
setIsoData, setIsoData,
setTheme, setTheme,
setupDateFns,
showAvatars, showAvatars,
showLocal, showLocal,
showScores, showScores,

View file

@ -1,19 +0,0 @@
import setDefaultOptions from "date-fns/setDefaultOptions";
import { I18NextService } from "../../services";
export default async function () {
let lang = I18NextService.i18n.language;
if (lang === "en") {
lang = "en-US";
}
const locale = (
await import(
/* webpackExclude: /\.js\.flow$/ */
`date-fns/locale/${lang}`
)
).default;
setDefaultOptions({
locale,
});
}