From: Anthony Lau Date: Thu, 23 Apr 2020 20:04:33 +0000 (+0800) Subject: [locale] zh-hk: Update meridiem hour range (#5160) X-Git-Tag: 2.25.0~83 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7793c0bdefadcd5ad58d9b4ad021efd485a03933;p=thirdparty%2Fmoment.git [locale] zh-hk: Update meridiem hour range (#5160) --- diff --git a/src/locale/zh-hk.js b/src/locale/zh-hk.js index 99435414e..910ca5957 100644 --- a/src/locale/zh-hk.js +++ b/src/locale/zh-hk.js @@ -3,6 +3,7 @@ //! author : Ben : https://github.com/ben-lin //! author : Chris Lam : https://github.com/hehachris //! author : Konstantin : https://github.com/skfd +//! author : Anthony : https://github.com/anthonylau import moment from '../moment'; @@ -43,9 +44,9 @@ export default moment.defineLocale('zh-hk', { return '凌晨'; } else if (hm < 900) { return '早上'; - } else if (hm < 1130) { + } else if (hm < 1200) { return '上午'; - } else if (hm < 1230) { + } else if (hm === 1200) { return '中午'; } else if (hm < 1800) { return '下午'; diff --git a/src/test/locale/zh-hk.js b/src/test/locale/zh-hk.js index 05947cfe5..b0c193881 100644 --- a/src/test/locale/zh-hk.js +++ b/src/test/locale/zh-hk.js @@ -169,16 +169,16 @@ test('calendar all else', function (assert) { test('meridiem', function (assert) { assert.equal(moment([2011, 2, 23, 0, 0]).format('a'), '凌晨', 'before dawn'); assert.equal(moment([2011, 2, 23, 6, 0]).format('a'), '早上', 'morning'); - assert.equal(moment([2011, 2, 23, 9, 0]).format('a'), '上午', 'before noon'); + assert.equal(moment([2011, 2, 23, 11, 59]).format('a'), '上午', 'before noon'); assert.equal(moment([2011, 2, 23, 12, 0]).format('a'), '中午', 'noon'); - assert.equal(moment([2011, 2, 23, 13, 0]).format('a'), '下午', 'after noon'); + assert.equal(moment([2011, 2, 23, 12, 1]).format('a'), '下午', 'after noon'); assert.equal(moment([2011, 2, 23, 18, 0]).format('a'), '晚上', 'night'); assert.equal(moment([2011, 2, 23, 0, 0]).format('A'), '凌晨', 'before dawn'); assert.equal(moment([2011, 2, 23, 6, 0]).format('A'), '早上', 'morning'); - assert.equal(moment([2011, 2, 23, 9, 0]).format('A'), '上午', 'before noon'); + assert.equal(moment([2011, 2, 23, 11, 59]).format('A'), '上午', 'before noon'); assert.equal(moment([2011, 2, 23, 12, 0]).format('A'), '中午', 'noon'); - assert.equal(moment([2011, 2, 23, 13, 0]).format('A'), '下午', 'afternoon'); + assert.equal(moment([2011, 2, 23, 12, 1]).format('A'), '下午', 'afternoon'); assert.equal(moment([2011, 2, 23, 18, 0]).format('A'), '晚上', 'night'); });