Skip to content

Commit

Permalink
fixed min/max dates in decade mode, fixes t1m0n#125
Browse files Browse the repository at this point in the history
  • Loading branch information
t1m0n committed Sep 26, 2016
1 parent f59bf95 commit 9bd8b00
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
5 changes: 3 additions & 2 deletions dist/js/datepicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -1911,10 +1911,11 @@
}
break;
case 'years':
if (!this.d._isInRange(new Date(y-10, m, d), 'year')) {
var decade = dp.getDecade(this.d.date);
if (!this.d._isInRange(new Date(decade[0] - 1, 0, 1), 'year')) {
this._disableNav('prev')
}
if (!this.d._isInRange(new Date(y+10, m, d), 'year')) {
if (!this.d._isInRange(new Date(decade[1] + 1, 0, 1), 'year')) {
this._disableNav('next')
}
break;
Expand Down
Loading

0 comments on commit 9bd8b00

Please sign in to comment.