]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
[locale] zh-tw: add spaces (#4430)
authorAdam <ayhaadam@gmail.com>
Mon, 5 Mar 2018 07:36:39 +0000 (15:36 +0800)
committerKunal Marwaha <marwahaha@berkeley.edu>
Mon, 5 Mar 2018 07:36:39 +0000 (23:36 -0800)
Properly add spaces between CJK characters and alphanumerics character and in calendar time format.

src/locale/zh-tw.js
src/test/locale/zh-tw.js

index 0e38007c3917dbf70bd61793b595155c5d23871f..5ad0d9ca0434f9f46593689e5bbc09b006828908 100644 (file)
@@ -53,11 +53,11 @@ export default moment.defineLocale('zh-tw', {
         }
     },
     calendar : {
-        sameDay : '[今天]LT',
-        nextDay : '[明天]LT',
-        nextWeek : '[下]ddddLT',
-        lastDay : '[昨天]LT',
-        lastWeek : '[上]ddddLT',
+        sameDay : '[今天] LT',
+        nextDay : '[明天] LT',
+        nextWeek : '[下]dddd LT',
+        lastDay : '[昨天] LT',
+        lastWeek : '[上]dddd LT',
         sameElse : 'L'
     },
     dayOfMonthOrdinalParse: /\d{1,2}(日|月|週)/,
index b6bbb3f40011a238a38abcdcc38c9cfb208a3c08..93ff243551003ac6d768865337f57441511e15d0 100644 (file)
@@ -119,23 +119,23 @@ test('fromNow', function (assert) {
 test('calendar day', function (assert) {
     var a = moment().hours(12).minutes(0).seconds(0);
 
-    assert.equal(moment(a).calendar(),                   '今天12:00', 'today at the same time');
-    assert.equal(moment(a).add({m: 25}).calendar(),      '今天12:25', 'Now plus 25 min');
-    assert.equal(moment(a).add({h: 1}).calendar(),       '今天13:00', 'Now plus 1 hour');
-    assert.equal(moment(a).add({d: 1}).calendar(),       '明天12:00', 'tomorrow at the same time');
-    assert.equal(moment(a).subtract({h: 1}).calendar(),  '今天11:00', 'Now minus 1 hour');
-    assert.equal(moment(a).subtract({d: 1}).calendar(),  '昨天12:00', 'yesterday at the same time');
+    assert.equal(moment(a).calendar(),                   '今天 12:00', 'today at the same time');
+    assert.equal(moment(a).add({m: 25}).calendar(),      '今天 12:25', 'Now plus 25 min');
+    assert.equal(moment(a).add({h: 1}).calendar(),       '今天 13:00', 'Now plus 1 hour');
+    assert.equal(moment(a).add({d: 1}).calendar(),       '明天 12:00', 'tomorrow at the same time');
+    assert.equal(moment(a).subtract({h: 1}).calendar(),  '今天 11:00', 'Now minus 1 hour');
+    assert.equal(moment(a).subtract({d: 1}).calendar(),  '昨天 12:00', 'yesterday at the same time');
 });
 
 test('calendar next week', function (assert) {
     var i, m;
     for (i = 2; i < 7; i++) {
         m = moment().add({d: i});
-        assert.equal(m.calendar(),       m.format('[下]ddddLT'),  'Today + ' + i + ' days current time');
+        assert.equal(m.calendar(),       m.format('[下]dddd LT'),  'Today + ' + i + ' days current time');
         m.hours(0).minutes(0).seconds(0).milliseconds(0);
-        assert.equal(m.calendar(),       m.format('[下]ddddLT'),  'Today + ' + i + ' days beginning of day');
+        assert.equal(m.calendar(),       m.format('[下]dddd LT'),  'Today + ' + i + ' days beginning of day');
         m.hours(23).minutes(59).seconds(59).milliseconds(999);
-        assert.equal(m.calendar(),       m.format('[下]ddddLT'),  'Today + ' + i + ' days end of day');
+        assert.equal(m.calendar(),       m.format('[下]dddd LT'),  'Today + ' + i + ' days end of day');
     }
 });
 
@@ -143,11 +143,11 @@ test('calendar last week', function (assert) {
     var i, m;
     for (i = 2; i < 7; i++) {
         m = moment().subtract({d: i});
-        assert.equal(m.calendar(),       m.format('[上]ddddLT'),  'Today - ' + i + ' days current time');
+        assert.equal(m.calendar(),       m.format('[上]dddd LT'),  'Today - ' + i + ' days current time');
         m.hours(0).minutes(0).seconds(0).milliseconds(0);
-        assert.equal(m.calendar(),       m.format('[上]ddddLT'),  'Today - ' + i + ' days beginning of day');
+        assert.equal(m.calendar(),       m.format('[上]dddd LT'),  'Today - ' + i + ' days beginning of day');
         m.hours(23).minutes(59).seconds(59).milliseconds(999);
-        assert.equal(m.calendar(),       m.format('[上]ddddLT'),  'Today - ' + i + ' days end of day');
+        assert.equal(m.calendar(),       m.format('[上]dddd LT'),  'Today - ' + i + ' days end of day');
     }
 });