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:
@@ -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');
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user