]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Add the minute unit of time for zh-cn and zh-tw locales and update tests.
authorChris Hemp <chris@chrishemp.com>
Wed, 15 Apr 2015 13:12:14 +0000 (09:12 -0400)
committerIskren Chernev <iskren.chernev@gmail.com>
Mon, 4 May 2015 04:10:58 +0000 (21:10 -0700)
src/locale/zh-cn.js
src/locale/zh-tw.js
src/test/locale/zh-cn.js
src/test/locale/zh-tw.js

index 3dcea9da09921baba8263afeef84622dc5c9a200..5be08568373ae2d6e22e806bc45a3e3b3662a396 100644 (file)
@@ -12,7 +12,7 @@ export default moment.defineLocale('zh-cn', {
     weekdaysShort : '周日_周一_周二_周三_周四_周五_周六'.split('_'),
     weekdaysMin : '日_一_二_三_四_五_六'.split('_'),
     longDateFormat : {
-        LT : 'Ah点mm',
+        LT : 'Ah点mm',
         LTS : 'Ah点m分s秒',
         L : 'YYYY-MM-DD',
         LL : 'YYYY年MMMD日',
index 2f2c0432908a9f6a827f485ca590e8001f9901d7..918700ae7722c5843a88f1b5cab7544e657554e4 100644 (file)
@@ -11,7 +11,7 @@ export default moment.defineLocale('zh-tw', {
     weekdaysShort : '週日_週一_週二_週三_週四_週五_週六'.split('_'),
     weekdaysMin : '日_一_二_三_四_五_六'.split('_'),
     longDateFormat : {
-        LT : 'Ah點mm',
+        LT : 'Ah點mm',
         LTS : 'Ah點m分s秒',
         L : 'YYYY年MMMD日',
         LL : 'YYYY年MMMD日',
@@ -89,4 +89,3 @@ export default moment.defineLocale('zh-tw', {
         yy : '%d年'
     }
 });
-
index 5f68b465ba37a930fac803f80a51a1ab65b2a360..fcfe3af15e3d0cae3061201c6ad92b5667718481 100644 (file)
@@ -41,12 +41,12 @@ test('format', function (assert) {
             ['LTS',                                '下午3点25分50秒'],
             ['L',                                  '2010-02-14'],
             ['LL',                                 '2010年2月14日'],
-            ['LLL',                                '2010年2月14日下午3点25'],
-            ['LLLL',                               '2010年2月14日星期日下午3点25'],
+            ['LLL',                                '2010年2月14日下午3点25'],
+            ['LLLL',                               '2010年2月14日星期日下午3点25'],
             ['l',                                  '2010-02-14'],
             ['ll',                                 '2010年2月14日'],
-            ['lll',                                '2010年2月14日下午3点25'],
-            ['llll',                               '2010年2月14日星期日下午3点25']
+            ['lll',                                '2010年2月14日下午3点25'],
+            ['llll',                               '2010年2月14日星期日下午3点25']
         ],
         b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
         i;
@@ -121,8 +121,8 @@ test('fromNow', function (assert) {
 test('calendar day', function (assert) {
     var a = moment().hours(2).minutes(0).seconds(0);
 
-    assert.equal(moment(a).calendar(),                     '今天凌晨2点整',     'today at the same time');
-    assert.equal(moment(a).add({m: 25}).calendar(),      '今天凌晨2点25',     'Now plus 25 min');
+    assert.equal(moment(a).calendar(),                   '今天凌晨2点整',     'today at the same time');
+    assert.equal(moment(a).add({m: 25}).calendar(),      '今天凌晨2点25分',   'Now plus 25 min');
     assert.equal(moment(a).add({h: 1}).calendar(),       '今天凌晨3点整',     'Now plus 1 hour');
     assert.equal(moment(a).add({d: 1}).calendar(),       '明天凌晨2点整',     'tomorrow at the same time');
     assert.equal(moment(a).subtract({h: 1}).calendar(),  '今天凌晨1点整',     'Now minus 1 hour');
index e95155ab153ed480d7e64795e6352958949fc1b3..1a2bf1de219726b96c24353f1d7740f8fa6d2014 100644 (file)
@@ -39,12 +39,12 @@ test('format', function (assert) {
             ['LTS',                                '下午3點25分50秒'],
             ['L',                                  '2010年2月14日'],
             ['LL',                                 '2010年2月14日'],
-            ['LLL',                                '2010年2月14日下午3點25'],
-            ['LLLL',                               '2010年2月14日星期日下午3點25'],
+            ['LLL',                                '2010年2月14日下午3點25'],
+            ['LLLL',                               '2010年2月14日星期日下午3點25'],
             ['l',                                  '2010年2月14日'],
             ['ll',                                 '2010年2月14日'],
-            ['lll',                                '2010年2月14日下午3點25'],
-            ['llll',                               '2010年2月14日星期日下午3點25']
+            ['lll',                                '2010年2月14日下午3點25'],
+            ['llll',                               '2010年2月14日星期日下午3點25']
         ],
         b = moment(new Date(2010, 1, 14, 15, 25, 50, 125)),
         i;
@@ -119,12 +119,12 @@ test('fromNow', function (assert) {
 test('calendar day', function (assert) {
     var a = moment().hours(2).minutes(0).seconds(0);
 
-    assert.equal(moment(a).calendar(),                     '今天早上2點00',     'today at the same time');
-    assert.equal(moment(a).add({m: 25}).calendar(),      '今天早上2點25',     'Now plus 25 min');
-    assert.equal(moment(a).add({h: 1}).calendar(),       '今天早上3點00',     'Now plus 1 hour');
-    assert.equal(moment(a).add({d: 1}).calendar(),       '明天早上2點00',     'tomorrow at the same time');
-    assert.equal(moment(a).subtract({h: 1}).calendar(),  '今天早上1點00',     'Now minus 1 hour');
-    assert.equal(moment(a).subtract({d: 1}).calendar(),  '昨天早上2點00',     'yesterday at the same time');
+    assert.equal(moment(a).calendar(),                   '今天早上2點00分',     'today at the same time');
+    assert.equal(moment(a).add({m: 25}).calendar(),      '今天早上2點25',     'Now plus 25 min');
+    assert.equal(moment(a).add({h: 1}).calendar(),       '今天早上3點00',     'Now plus 1 hour');
+    assert.equal(moment(a).add({d: 1}).calendar(),       '明天早上2點00',     'tomorrow at the same time');
+    assert.equal(moment(a).subtract({h: 1}).calendar(),  '今天早上1點00',     'Now minus 1 hour');
+    assert.equal(moment(a).subtract({d: 1}).calendar(),  '昨天早上2點00',     'yesterday at the same time');
 });
 
 test('calendar next week', function (assert) {