Skip to content

Commit

Permalink
Fixed #3337
Browse files Browse the repository at this point in the history
  • Loading branch information
Çağatay Çivici committed Jul 26, 2017
1 parent 18c6dcb commit fa998dd
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/app/components/calendar/calendar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,10 @@ export class Calendar implements AfterViewInit,AfterViewChecked,OnInit,OnDestroy
if(this.currentMonth === 0) {
this.currentMonth = 11;
this.currentYear--;

if(this.yearNavigator && this.currentYear < this.yearOptions[0]) {
this.currentYear = this.yearOptions[this.yearOptions.length - 1];
}
}
else {
this.currentMonth--;
Expand All @@ -473,10 +477,14 @@ export class Calendar implements AfterViewInit,AfterViewChecked,OnInit,OnDestroy
event.preventDefault();
return;
}

if(this.currentMonth === 11) {
this.currentMonth = 0;
this.currentYear++;

if(this.yearNavigator && this.currentYear > this.yearOptions[this.yearOptions.length - 1]) {
this.currentYear = this.yearOptions[0];
}
}
else {
this.currentMonth++;
Expand Down

0 comments on commit fa998dd

Please sign in to comment.