We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a0abee2 commit 2f1db06Copy full SHA for 2f1db06
test/locale/zh-tw.test.js
@@ -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