fix handlePick and remove console.log
removed if/else related to b52e02e436
This commit is contained in:
parent
71b68751f8
commit
bcf09be744
2 changed files with 2 additions and 9 deletions
|
@ -221,7 +221,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
selectionMode(type){
|
selectionMode(type){
|
||||||
console.log('Selection type change!', type);
|
|
||||||
this.currentView = type || 'range';
|
this.currentView = type || 'range';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
|
@ -168,18 +168,12 @@
|
||||||
this.pickerTable = this.getTableType(this.currentView);
|
this.pickerTable = this.getTableType(this.currentView);
|
||||||
},
|
},
|
||||||
handlePick (value) {
|
handlePick (value) {
|
||||||
const {selectionMode, panelDate, pickerType} = this;
|
const {selectionMode, panelDate} = this;
|
||||||
if (selectionMode === 'year') value = new Date(value.getFullYear(), 0, 1);
|
if (selectionMode === 'year') value = new Date(value.getFullYear(), 0, 1);
|
||||||
else if (selectionMode === 'month') value = new Date(panelDate.getFullYear(), value.getMonth(), 1);
|
else if (selectionMode === 'month') value = new Date(panelDate.getFullYear(), value.getMonth(), 1);
|
||||||
else value = new Date(value);
|
else value = new Date(value);
|
||||||
|
|
||||||
if (pickerType === selectionMode){
|
this.$emit('on-pick', value);
|
||||||
this.$emit('on-pick', value);
|
|
||||||
} else {
|
|
||||||
this.selectionMode
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue