Skip to content

Commit af75753

Browse files
committed
test: add tests for issue #1734
1 parent 47a683b commit af75753

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/plugin/customParseFormat.test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,24 @@ it('parse HH:mm:ss but only one digit', () => {
143143
expect(dayjs(input, format).valueOf()).toBe(moment(input, format).valueOf())
144144
})
145145

146+
it('parse HH:mm:ss.SSS', () => {
147+
const input = '00:27:21.123'
148+
const format = 'HH:mm:ss.SSS'
149+
expect(dayjs(input, format).valueOf()).toBe(moment(input, format).valueOf())
150+
})
151+
152+
it('parse HH:mm:ss.SS', () => {
153+
const input = '00:27:21.12'
154+
const format = 'HH:mm:ss.SS'
155+
expect(dayjs(input, format).valueOf()).toBe(moment(input, format).valueOf())
156+
})
157+
158+
it('parse HH:mm:ss.S', () => {
159+
const input = '00:27:21.1'
160+
const format = 'HH:mm:ss.S'
161+
expect(dayjs(input, format).valueOf()).toBe(moment(input, format).valueOf())
162+
})
163+
146164
describe('parse YYYY / YYYY-MM only', () => {
147165
it('YYYY', () => {
148166
const input = '2001 +08:00'

0 commit comments

Comments
 (0)