Correct year date navigation logic

This commit is contained in:
Sergio Crisostomo 2018-01-19 10:59:44 +01:00
parent 8f6aeda4be
commit 77e43f2b87
2 changed files with 34 additions and 16 deletions

View file

@ -145,7 +145,11 @@
},
methods: {
changeYear(dir){
this.panelDate = siblingMonth(this.panelDate, dir * 12);
if (this.selectionMode === 'year'){
this.panelDate = new Date(this.panelDate.getFullYear() + dir * 10, 0, 1);
} else {
this.panelDate = siblingMonth(this.panelDate, dir * 12);
}
},
changeMonth(dir){
this.panelDate = siblingMonth(this.panelDate, dir);