Expose changed date component

This commit is contained in:
Sergio Crisostomo 2018-04-11 14:31:14 +02:00
parent eed5708494
commit 90ebd5a72c
6 changed files with 14 additions and 14 deletions

View file

@ -188,14 +188,14 @@
else this.pickerTable = this.getTableType(this.currentView);
},
handlePick (value) {
handlePick (value, type) {
const {selectionMode, panelDate} = this;
if (selectionMode === 'year') value = new Date(value.getFullYear(), 0, 1);
else if (selectionMode === 'month') value = new Date(panelDate.getFullYear(), value.getMonth(), 1);
else value = new Date(value);
this.dates = [value];
this.$emit('on-pick', value);
this.$emit('on-pick', value, false, type || selectionMode);
},
},
};