Skip to content

Commit

Permalink
Resolve issue moment#3014 inconsistent relativeTime locale in zh-tw
Browse files Browse the repository at this point in the history
  • Loading branch information
gaplo917 authored and ichernev committed Apr 16, 2016
1 parent d1332bc commit 29e863e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
10 changes: 5 additions & 5 deletions src/locale/zh-tw.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ export default moment.defineLocale('zh-tw', {
future : '%s內',
past : '%s前',
s : '幾秒',
m : '一分鐘',
m : '1分鐘',
mm : '%d分鐘',
h : '一小時',
h : '1小時',
hh : '%d小時',
d : '一天',
d : '1天',
dd : '%d天',
M : '一個月',
M : '1個月',
MM : '%d個月',
y : '一年',
y : '1年',
yy : '%d年'
}
});
26 changes: 13 additions & 13 deletions src/test/locale/zh-tw.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,32 +73,32 @@ test('format week', function (assert) {
test('from', function (assert) {
var start = moment([2007, 1, 28]);
assert.equal(start.from(moment([2007, 1, 28]).add({s: 44}), true), '幾秒', '44 seconds = a few seconds');
assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), '一分鐘', '45 seconds = a minute');
assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), '一分鐘', '89 seconds = a minute');
assert.equal(start.from(moment([2007, 1, 28]).add({s: 45}), true), '1分鐘', '45 seconds = a minute');
assert.equal(start.from(moment([2007, 1, 28]).add({s: 89}), true), '1分鐘', '89 seconds = a minute');
assert.equal(start.from(moment([2007, 1, 28]).add({s: 90}), true), '2分鐘', '90 seconds = 2 minutes');
assert.equal(start.from(moment([2007, 1, 28]).add({m: 44}), true), '44分鐘', '44 minutes = 44 minutes');
assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), '一小時', '45 minutes = an hour');
assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), '一小時', '89 minutes = an hour');
assert.equal(start.from(moment([2007, 1, 28]).add({m: 45}), true), '1小時', '45 minutes = an hour');
assert.equal(start.from(moment([2007, 1, 28]).add({m: 89}), true), '1小時', '89 minutes = an hour');
assert.equal(start.from(moment([2007, 1, 28]).add({m: 90}), true), '2小時', '90 minutes = 2 hours');
assert.equal(start.from(moment([2007, 1, 28]).add({h: 5}), true), '5小時', '5 hours = 5 hours');
assert.equal(start.from(moment([2007, 1, 28]).add({h: 21}), true), '21小時', '21 hours = 21 hours');
assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), '一天', '22 hours = a day');
assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), '一天', '35 hours = a day');
assert.equal(start.from(moment([2007, 1, 28]).add({h: 22}), true), '1天', '22 hours = a day');
assert.equal(start.from(moment([2007, 1, 28]).add({h: 35}), true), '1天', '35 hours = a day');
assert.equal(start.from(moment([2007, 1, 28]).add({h: 36}), true), '2天', '36 hours = 2 days');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), '一天', '1 day = a day');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 1}), true), '1天', '1 day = a day');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 5}), true), '5天', '5 days = 5 days');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 25}), true), '25天', '25 days = 25 days');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), '一個月', '26 days = a month');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), '一個月', '30 days = a month');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), '一個月', '43 days = a month');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 26}), true), '1個月', '26 days = a month');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 30}), true), '1個月', '30 days = a month');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 43}), true), '1個月', '43 days = a month');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 46}), true), '2個月', '46 days = 2 months');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 74}), true), '2個月', '75 days = 2 months');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 76}), true), '3個月', '76 days = 3 months');
assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), '一個月', '1 month = a month');
assert.equal(start.from(moment([2007, 1, 28]).add({M: 1}), true), '1個月', '1 month = a month');
assert.equal(start.from(moment([2007, 1, 28]).add({M: 5}), true), '5個月', '5 months = 5 months');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), '一年', '345 days = a year');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 345}), true), '1年', '345 days = a year');
assert.equal(start.from(moment([2007, 1, 28]).add({d: 548}), true), '2年', '548 days = 2 years');
assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), '一年', '1 year = a year');
assert.equal(start.from(moment([2007, 1, 28]).add({y: 1}), true), '1年', '1 year = a year');
assert.equal(start.from(moment([2007, 1, 28]).add({y: 5}), true), '5年', '5 years = 5 years');
});

Expand Down

0 comments on commit 29e863e

Please sign in to comment.