From 6d8c5666a5b0ab935ac6db6543f66d738ec29229 Mon Sep 17 00:00:00 2001 From: Sergio Crisostomo Date: Wed, 11 Apr 2018 08:39:54 +0200 Subject: [PATCH] Correct logic for side panel date --- src/components/date-picker/panel/Date/date-range.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/date-picker/panel/Date/date-range.vue b/src/components/date-picker/panel/Date/date-range.vue index a3f9458b..b093ede4 100644 --- a/src/components/date-picker/panel/Date/date-range.vue +++ b/src/components/date-picker/panel/Date/date-range.vue @@ -275,11 +275,12 @@ nextMonth(panel){ this.changePanelDate(panel, 'Month', 1); }, - changePanelDate(panel, type, increment){ + changePanelDate(panel, type, increment, updateOtherPanel = true){ const current = new Date(this[`${panel}PanelDate`]); current[`set${type}`](current[`get${type}`]() + increment); this[`${panel}PanelDate`] = current; + if (!updateOtherPanel) return; if (this.splitPanels){ // change other panel if dates overlap @@ -312,9 +313,8 @@ if (!this.splitPanels){ const otherPanel = panel === 'left' ? 'right' : 'left'; - const type = currentViewType === 'year-table' ? 'FullYear' : 'Month'; this[`${otherPanel}PanelDate`] = value; - this.changePanelDate(otherPanel, type, 1); + this.changePanelDate(otherPanel, 'Month', 1, false); } }, handleRangePick (val) {