]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
[locale] zh-hk: Update meridiem hour range (#5160)
authorAnthony Lau <anthonylau@users.noreply.github.com>
Thu, 23 Apr 2020 20:04:33 +0000 (04:04 +0800)
committerGitHub <noreply@github.com>
Thu, 23 Apr 2020 20:04:33 +0000 (23:04 +0300)
src/locale/zh-hk.js
src/test/locale/zh-hk.js

index 99435414e4215a5bde4439cd58d3b9ee24b64e32..910ca595753cc61e1f32fcded44d00796f80907c 100644 (file)
@@ -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 '下午';
index 05947cfe539e9f0d51eae7e412d7556c23d2328e..b0c19388151d977397bc788d11a3998af2821845 100644 (file)
@@ -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');
 });