Skip to content

Commit e65a326

Browse files
linyuqing222Kevin Lin
authored andcommitted
feat: Add locale (zh-tw) meridiem
1 parent cbe91fd commit e65a326

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/locale/zh-tw.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,21 @@ const locale = {
4242
MM: '%d 個月',
4343
y: '1 年',
4444
yy: '%d 年'
45+
},
46+
meridiem: (hour, minute) => {
47+
const hm = (hour * 100) + minute
48+
if (hm < 600) {
49+
return '凌晨'
50+
} else if (hm < 900) {
51+
return '早上'
52+
} else if (hm < 1100) {
53+
return '上午'
54+
} else if (hm < 1300) {
55+
return '中午'
56+
} else if (hm < 1800) {
57+
return '下午'
58+
}
59+
return '晚上'
4560
}
4661
}
4762

0 commit comments

Comments
 (0)