Replace momentjs with date-fns
This commit is contained in:
parent
f5b958f884
commit
d0dff77377
12 changed files with 187 additions and 79 deletions
|
@ -1,22 +1,39 @@
|
|||
import { initializeSite } from "@utils/app";
|
||||
import setDefaultOptions from "date-fns/setDefaultOptions";
|
||||
import { hydrate } from "inferno-hydrate";
|
||||
import { Router } from "inferno-router";
|
||||
import { App } from "../shared/components/app/app";
|
||||
import { HistoryService } from "../shared/services";
|
||||
import { HistoryService, I18NextService } from "../shared/services";
|
||||
|
||||
import "bootstrap/js/dist/collapse";
|
||||
import "bootstrap/js/dist/dropdown";
|
||||
|
||||
initializeSite(window.isoData.site_res);
|
||||
async function startClient() {
|
||||
initializeSite(window.isoData.site_res);
|
||||
|
||||
const wrapper = (
|
||||
<Router history={HistoryService.history}>
|
||||
<App />
|
||||
</Router>
|
||||
);
|
||||
const lang = I18NextService.i18n.language;
|
||||
const locale = (
|
||||
await import(
|
||||
/* webpackExclude: /\.js\.flow$/ */
|
||||
`date-fns/locale/${lang}`
|
||||
)
|
||||
).default;
|
||||
|
||||
const root = document.getElementById("root");
|
||||
setDefaultOptions({
|
||||
locale,
|
||||
});
|
||||
|
||||
if (root) {
|
||||
hydrate(wrapper, root);
|
||||
const wrapper = (
|
||||
<Router history={HistoryService.history}>
|
||||
<App />
|
||||
</Router>
|
||||
);
|
||||
|
||||
const root = document.getElementById("root");
|
||||
|
||||
if (root) {
|
||||
hydrate(wrapper, root);
|
||||
}
|
||||
}
|
||||
|
||||
startClient();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue