]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
[bugfix] moment#5327 output wrong next week in ja locale (#5329)
authorTerrence Wong <wongtk1997@gmail.com>
Thu, 23 Apr 2020 15:04:18 +0000 (23:04 +0800)
committerGitHub <noreply@github.com>
Thu, 23 Apr 2020 15:04:18 +0000 (18:04 +0300)
* Fix moment#5327 output wrong next week string when in last week of the year in ja locale

* Fix moment#5327 output wrong next week string when in next week of the year in ja locale

src/locale/ja.js

index af3e1da015e1a8a8758d5347135ca334c074c5c9..a09b79a0cda921022be8bf495c21b7449a1fe5d9 100644 (file)
@@ -37,7 +37,7 @@ export default moment.defineLocale('ja', {
         sameDay : '[今日] LT',
         nextDay : '[明日] LT',
         nextWeek : function (now) {
-            if (now.week() < this.week()) {
+            if (now.week() !== this.week()) {
                 return '[来週]dddd LT';
             } else {
                 return 'dddd LT';
@@ -45,7 +45,7 @@ export default moment.defineLocale('ja', {
         },
         lastDay : '[昨日] LT',
         lastWeek : function (now) {
-            if (this.week() < now.week()) {
+            if (this.week() !== now.week()) {
                 return '[先週]dddd LT';
             } else {
                 return 'dddd LT';