Commit 0fd136966029f49fd0d7a92ccda057ed49c56460
1 parent
af713093
fixed DatePicker event when type = daterange
fixed DatePicker event when type = daterange
Showing
1 changed file
with
6 additions
and
1 deletions
Show diff stats
src/components/date-picker/picker.vue
@@ -414,7 +414,12 @@ | @@ -414,7 +414,12 @@ | ||
414 | TYPE_VALUE_RESOLVER_MAP['default'] | 414 | TYPE_VALUE_RESOLVER_MAP['default'] |
415 | ).formatter; | 415 | ).formatter; |
416 | 416 | ||
417 | - this.$emit('on-change', formatter(date, format)); | 417 | + let newDate = formatter(date, format); |
418 | + if (this.type === 'daterange') { | ||
419 | + newDate = [newDate.split(RANGE_SEPARATOR)[0], newDate.split(RANGE_SEPARATOR)[1]]; | ||
420 | + } | ||
421 | + | ||
422 | + this.$emit('on-change', newDate); | ||
418 | } | 423 | } |
419 | }, | 424 | }, |
420 | watch: { | 425 | watch: { |