Skip to content

Commit

Permalink
fix: moment i18n error
Browse files Browse the repository at this point in the history
  • Loading branch information
Reamd7 committed Feb 26, 2022
1 parent addeac7 commit 0851a85
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion notion-zh_CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -8972,7 +8972,7 @@

function insertMoment() {
try {
moment.updateLocale(lang, {
moment.updateLocale(lang.toLowerCase(), {
longDateFormat: {
LT: "h:mm A",
LTS: "h:mm:ss A",
Expand All @@ -8986,6 +8986,7 @@
llll: "YYYY年M月D日dddd HH:mm",
},
});
moment.locale(lang.toLowerCase())
} catch (e) {
requestAnimationFrame(() => {
insertMoment();
Expand Down
3 changes: 2 additions & 1 deletion template/notion-zh_CN.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

function insertMoment() {
try {
moment.updateLocale(lang, {
moment.updateLocale(lang.toLowerCase(), {
longDateFormat: {
LT: "h:mm A",
LTS: "h:mm:ss A",
Expand All @@ -51,6 +51,7 @@
llll: "YYYY年M月D日dddd HH:mm",
},
});
moment.locale(lang.toLowerCase())
} catch (e) {
requestAnimationFrame(() => {
insertMoment();
Expand Down

0 comments on commit 0851a85

Please sign in to comment.