Commit 6d8c5666a5b0ab935ac6db6543f66d738ec29229
1 parent
948accad
Correct logic for side panel date
Showing
1 changed file
with
3 additions
and
3 deletions
Show diff stats
src/components/date-picker/panel/Date/date-range.vue
| @@ -275,11 +275,12 @@ | @@ -275,11 +275,12 @@ | ||
| 275 | nextMonth(panel){ | 275 | nextMonth(panel){ |
| 276 | this.changePanelDate(panel, 'Month', 1); | 276 | this.changePanelDate(panel, 'Month', 1); |
| 277 | }, | 277 | }, |
| 278 | - changePanelDate(panel, type, increment){ | 278 | + changePanelDate(panel, type, increment, updateOtherPanel = true){ |
| 279 | const current = new Date(this[`${panel}PanelDate`]); | 279 | const current = new Date(this[`${panel}PanelDate`]); |
| 280 | current[`set${type}`](current[`get${type}`]() + increment); | 280 | current[`set${type}`](current[`get${type}`]() + increment); |
| 281 | this[`${panel}PanelDate`] = current; | 281 | this[`${panel}PanelDate`] = current; |
| 282 | 282 | ||
| 283 | + if (!updateOtherPanel) return; | ||
| 283 | 284 | ||
| 284 | if (this.splitPanels){ | 285 | if (this.splitPanels){ |
| 285 | // change other panel if dates overlap | 286 | // change other panel if dates overlap |
| @@ -312,9 +313,8 @@ | @@ -312,9 +313,8 @@ | ||
| 312 | 313 | ||
| 313 | if (!this.splitPanels){ | 314 | if (!this.splitPanels){ |
| 314 | const otherPanel = panel === 'left' ? 'right' : 'left'; | 315 | const otherPanel = panel === 'left' ? 'right' : 'left'; |
| 315 | - const type = currentViewType === 'year-table' ? 'FullYear' : 'Month'; | ||
| 316 | this[`${otherPanel}PanelDate`] = value; | 316 | this[`${otherPanel}PanelDate`] = value; |
| 317 | - this.changePanelDate(otherPanel, type, 1); | 317 | + this.changePanelDate(otherPanel, 'Month', 1, false); |
| 318 | } | 318 | } |
| 319 | }, | 319 | }, |
| 320 | handleRangePick (val) { | 320 | handleRangePick (val) { |