]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Fix issue with DST transition in Chinese locale
authorMatt Johnson <mj1856@hotmail.com>
Thu, 10 Mar 2016 03:50:36 +0000 (19:50 -0800)
committerIskren Chernev <iskren.chernev@gmail.com>
Sat, 16 Apr 2016 08:08:48 +0000 (01:08 -0700)
src/locale/zh-cn.js

index 790ea8bc390b36ce641d3386adf54ba8ed8024f1..d9db71730112100abb9477dce250b484c7a3652c 100644 (file)
@@ -67,7 +67,7 @@ export default moment.defineLocale('zh-cn', {
         nextWeek : function () {
             var startOfWeek, prefix;
             startOfWeek = moment().startOf('week');
-            prefix = this.unix() - startOfWeek.unix() >= 7 * 24 * 3600 ? '[下]' : '[本]';
+            prefix = this.diff(startOfWeek, 'days') >= 7 ? '[下]' : '[本]';
             return this.minutes() === 0 ? prefix + 'dddAh点整' : prefix + 'dddAh点mm';
         },
         lastWeek : function () {