From 6cbc18df20d0b44a6ae8a3a54d7ac690f4a7bda6 Mon Sep 17 00:00:00 2001 From: SleeplessOne1917 Date: Sun, 25 Jun 2023 15:12:43 -0400 Subject: [PATCH] (Hopefully_ fix datefn localization issues --- src/client/index.tsx | 4 +--- src/server/index.tsx | 2 -- src/shared/utils/app/index.ts | 2 -- src/shared/utils/app/setup-date-fns.ts | 19 ------------------- 4 files changed, 1 insertion(+), 26 deletions(-) delete mode 100644 src/shared/utils/app/setup-date-fns.ts diff --git a/src/client/index.tsx b/src/client/index.tsx index 36059f97..51455c7f 100644 --- a/src/client/index.tsx +++ b/src/client/index.tsx @@ -1,4 +1,4 @@ -import { initializeSite, setupDateFns } from "@utils/app"; +import { initializeSite } from "@utils/app"; import { hydrate } from "inferno-hydrate"; import { Router } from "inferno-router"; import { App } from "../shared/components/app/app"; @@ -10,8 +10,6 @@ import "bootstrap/js/dist/dropdown"; async function startClient() { initializeSite(window.isoData.site_res); - await setupDateFns(); - const wrapper = ( diff --git a/src/server/index.tsx b/src/server/index.tsx index 25a1be64..b65506b0 100644 --- a/src/server/index.tsx +++ b/src/server/index.tsx @@ -1,4 +1,3 @@ -import { setupDateFns } from "@utils/app"; import express from "express"; import path from "path"; import process from "process"; @@ -32,7 +31,6 @@ server.get("/css/themelist", ThemesListHandler); server.get("/*", CatchAllHandler); server.listen(Number(port), hostname, () => { - setupDateFns(); console.log(`http://${hostname}:${port}`); }); diff --git a/src/shared/utils/app/index.ts b/src/shared/utils/app/index.ts index f98357d7..268603e7 100644 --- a/src/shared/utils/app/index.ts +++ b/src/shared/utils/app/index.ts @@ -46,7 +46,6 @@ import searchCommentTree from "./search-comment-tree"; import selectableLanguages from "./selectable-languages"; import setIsoData from "./set-iso-data"; import setTheme from "./set-theme"; -import setupDateFns from "./setup-date-fns"; import showAvatars from "./show-avatars"; import showLocal from "./show-local"; import showScores from "./show-scores"; @@ -105,7 +104,6 @@ export { selectableLanguages, setIsoData, setTheme, - setupDateFns, showAvatars, showLocal, showScores, diff --git a/src/shared/utils/app/setup-date-fns.ts b/src/shared/utils/app/setup-date-fns.ts deleted file mode 100644 index fe957205..00000000 --- a/src/shared/utils/app/setup-date-fns.ts +++ /dev/null @@ -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, - }); -}