Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[locale] Update zh-hk meridiem hour range #5160

Merged
merged 2 commits into from Apr 23, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/locale/zh-hk.js
Expand Up @@ -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';

Expand Down Expand Up @@ -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 '下午';
Expand Down
8 changes: 4 additions & 4 deletions src/test/locale/zh-hk.js
Expand Up @@ -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');
});

Expand Down