From ba3ad889e451442fd164a6b607800ac0e7fc342f Mon Sep 17 00:00:00 2001 From: SergioCrisostomo Date: Fri, 10 Aug 2018 15:23:13 +0200 Subject: [PATCH] Use last selected date in date panel navigation --- src/components/date-picker/panel/Date/date.vue | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/date-picker/panel/Date/date.vue b/src/components/date-picker/panel/Date/date.vue index 33360eb..917a922 100644 --- a/src/components/date-picker/panel/Date/date.vue +++ b/src/components/date-picker/panel/Date/date.vue @@ -150,7 +150,8 @@ watch: { value (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) { this.$emit('on-selection-mode-change', currentView); @@ -170,7 +171,7 @@ const isDifferentYear = date.getFullYear() !== this.panelDate.getFullYear(); const isDifferentMonth = isDifferentYear || date.getMonth() !== this.panelDate.getMonth(); if (isDifferentYear || isDifferentMonth){ - this.panelDate = date; + if (!this.multiple) this.panelDate = date; } } }, -- libgit2 0.21.4