Skip to content

Commit 0a1bd08

Browse files
authoredJul 19, 2022
fix: zh-tw / zh-hk locale ordinal error (#1976)
1 parent fd51fe4 commit 0a1bd08

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed
 

‎src/locale/zh-hk.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@ const locale = {
88
weekdays: '星期日_星期一_星期二_星期三_星期四_星期五_星期六'.split('_'),
99
weekdaysShort: '週日_週一_週二_週三_週四_週五_週六'.split('_'),
1010
weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
11-
ordinal: n => `${n}日`,
11+
ordinal: (number, period) => {
12+
switch (period) {
13+
case 'W':
14+
return `${number}週`
15+
default:
16+
return `${number}日`
17+
}
18+
},
1219
formats: {
1320
LT: 'HH:mm',
1421
LTS: 'HH:mm:ss',

‎src/locale/zh-tw.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,14 @@ const locale = {
88
weekdaysMin: '日_一_二_三_四_五_六'.split('_'),
99
months: '一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月'.split('_'),
1010
monthsShort: '1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月'.split('_'),
11-
ordinal: n => `${n}日`,
11+
ordinal: (number, period) => {
12+
switch (period) {
13+
case 'W':
14+
return `${number}週`
15+
default:
16+
return `${number}日`
17+
}
18+
},
1219
formats: {
1320
LT: 'HH:mm',
1421
LTS: 'HH:mm:ss',

0 commit comments

Comments
 (0)
Please sign in to comment.