mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-25 22:01:13 +00:00
(Hopefully_ fix datefn localization issues
This commit is contained in:
parent
0866296f2c
commit
6cbc18df20
4 changed files with 1 additions and 26 deletions
|
@ -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 = (
|
||||
<Router history={HistoryService.history}>
|
||||
<App />
|
||||
|
|
|
@ -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}`);
|
||||
});
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
});
|
||||
}
|
Loading…
Reference in a new issue