Use last selected date in date panel navigation
This commit is contained in:
parent
6f8160270d
commit
ba3ad889e4
1 changed files with 3 additions and 2 deletions
|
@ -150,7 +150,8 @@
|
||||||
watch: {
|
watch: {
|
||||||
value (newVal) {
|
value (newVal) {
|
||||||
this.dates = newVal;
|
this.dates = newVal;
|
||||||
this.panelDate = this.startDate || (this.multiple ? this.dates[this.dates.length - 1] : this.dates[0]) || new Date();
|
const panelDate = this.multiple ? this.dates[this.dates.length - 1] : (this.startDate || this.dates[0]);
|
||||||
|
this.panelDate = panelDate || new Date();
|
||||||
},
|
},
|
||||||
currentView (currentView) {
|
currentView (currentView) {
|
||||||
this.$emit('on-selection-mode-change', currentView);
|
this.$emit('on-selection-mode-change', currentView);
|
||||||
|
@ -170,7 +171,7 @@
|
||||||
const isDifferentYear = date.getFullYear() !== this.panelDate.getFullYear();
|
const isDifferentYear = date.getFullYear() !== this.panelDate.getFullYear();
|
||||||
const isDifferentMonth = isDifferentYear || date.getMonth() !== this.panelDate.getMonth();
|
const isDifferentMonth = isDifferentYear || date.getMonth() !== this.panelDate.getMonth();
|
||||||
if (isDifferentYear || isDifferentMonth){
|
if (isDifferentYear || isDifferentMonth){
|
||||||
this.panelDate = date;
|
if (!this.multiple) this.panelDate = date;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Reference in a new issue