Skip to content

Commit 2f1db06

Browse files
committed
add test for zh-tw locale
1 parent a0abee2 commit 2f1db06

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/locale/zh-tw.test.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import dayjs from '../../src'
2+
import advancedFormat from '../../src/plugin/advancedFormat'
3+
import weekOfYear from '../../src/plugin/weekOfYear'
4+
import '../../src/locale/zh'
5+
import '../../src/locale/zh-tw'
6+
7+
dayjs.extend(advancedFormat).extend(weekOfYear)
8+
9+
const zh = dayjs().locale('zh')
10+
const zhTW = dayjs().locale('zh-tw')
11+
12+
test('ordinal', () => {
13+
expect(zh.format('wo')).toEqual(`${zh.format('w')}周`)
14+
expect(zhTW.format('wo')).toEqual(`${zhTW.format('w')}週`)
15+
})
16+
17+
test('Meridiem', () => {
18+
for (let i = 0; i <= 24; i += 1) {
19+
expect(zh.add(i, 'hour').format('A')).toBe(zhTW.add(i, 'hour').format('A'))
20+
}
21+
})

0 commit comments

Comments
 (0)