-
Notifications
You must be signed in to change notification settings - Fork 307
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: time format only support HH:mm:ss (#1924)
* fix: time format only support HH:mm:ss * chore: add test unit
- Loading branch information
1 parent
056e162
commit 562f93e
Showing
2 changed files
with
23 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { extractTimeFormat } from '../../../js/date-picker/utils'; | ||
|
||
describe('utils', () => { | ||
describe(' extractTimeFormat', () => { | ||
it('YYYY-MM-DD HH:mm:ss', () => { | ||
const res = extractTimeFormat('YYYY-MM-DD HH:mm:ss'); | ||
expect(res).toBe('HH:mm:ss'); | ||
}); | ||
|
||
it('YYYY-MM-DD HH时mm分ss秒', () => { | ||
const res = extractTimeFormat('YYYY-MM-DD HH时mm分ss秒'); | ||
expect(res).toBe('HH时mm分ss秒'); | ||
}); | ||
|
||
it('YYYY-MM-DD HH时mm分ss秒SSS毫秒', () => { | ||
const res = extractTimeFormat('YYYY-MM-DD HH时mm分ss秒SSS毫秒'); | ||
expect(res).toBe('HH时mm分ss秒SSS毫秒'); | ||
}); | ||
}); | ||
}); |