Merge pull request #3348 from SergioCrisostomo/fix-3345
Correct logic for side panel date
This commit is contained in:
commit
4a1b803512
1 changed files with 3 additions and 3 deletions
|
@ -275,11 +275,12 @@
|
||||||
nextMonth(panel){
|
nextMonth(panel){
|
||||||
this.changePanelDate(panel, 'Month', 1);
|
this.changePanelDate(panel, 'Month', 1);
|
||||||
},
|
},
|
||||||
changePanelDate(panel, type, increment){
|
changePanelDate(panel, type, increment, updateOtherPanel = true){
|
||||||
const current = new Date(this[`${panel}PanelDate`]);
|
const current = new Date(this[`${panel}PanelDate`]);
|
||||||
current[`set${type}`](current[`get${type}`]() + increment);
|
current[`set${type}`](current[`get${type}`]() + increment);
|
||||||
this[`${panel}PanelDate`] = current;
|
this[`${panel}PanelDate`] = current;
|
||||||
|
|
||||||
|
if (!updateOtherPanel) return;
|
||||||
|
|
||||||
if (this.splitPanels){
|
if (this.splitPanels){
|
||||||
// change other panel if dates overlap
|
// change other panel if dates overlap
|
||||||
|
@ -312,9 +313,8 @@
|
||||||
|
|
||||||
if (!this.splitPanels){
|
if (!this.splitPanels){
|
||||||
const otherPanel = panel === 'left' ? 'right' : 'left';
|
const otherPanel = panel === 'left' ? 'right' : 'left';
|
||||||
const type = currentViewType === 'year-table' ? 'FullYear' : 'Month';
|
|
||||||
this[`${otherPanel}PanelDate`] = value;
|
this[`${otherPanel}PanelDate`] = value;
|
||||||
this.changePanelDate(otherPanel, type, 1);
|
this.changePanelDate(otherPanel, 'Month', 1, false);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
handleRangePick (val) {
|
handleRangePick (val) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue