2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-06-22 19:00:37 +03:00

feat: add prop formatter to replace the object usage of format

This commit is contained in:
mengxiong10
2020-10-20 16:07:13 +08:00
parent 7763a8d0aa
commit 5d3d54705f
5 changed files with 97 additions and 72 deletions
+2 -2
View File
@@ -135,14 +135,14 @@ describe('DatePicker', () => {
expect(input.value).toBe('2019/10/10');
});
it('prop: custom format', () => {
it('prop: formatter', () => {
wrapper = mount(DatePicker, {
propsData: {
valueType: 'format',
value: '13/10/2019',
open: true,
type: 'week',
format: {
formatter: {
stringify(date) {
return format(date, 'dd/MM/yyyy');
},