@@ -139,10 +139,8 @@ $.extend(Datepicker.prototype, {
139139 keystroke : { keyCode : 33 , ctrlKey : true } , // Ctrl + Page up
140140 enabled : function ( inst ) {
141141 var minDate = inst . curMinDate ( ) ;
142- return ( ! minDate || plugin . add ( plugin . day (
143- plugin . _applyMonthsOffset ( plugin . add ( plugin . newDate ( inst . drawDate ) ,
144- 1 - inst . options . monthsToJump , 'm' ) , inst ) , 1 ) , - 1 , 'd' ) .
145- getTime ( ) >= minDate . getTime ( ) ) ; } ,
142+ var date = plugin . add ( plugin . day ( plugin . _applyMonthsOffset ( plugin . add ( plugin . newDate ( inst . drawDate ) , 1 - inst . options . monthsToJump , 'm' ) , inst ) , 1 ) , - 1 , 'd' ) ;
143+ return ( ! minDate || ( date . getFullYear ( ) * 100 ) + date . getMonth ( ) > ( minDate . getFullYear ( ) * 100 ) + minDate . getMonth ( ) ) ; } ,
146144 date : function ( inst ) {
147145 return plugin . day ( plugin . _applyMonthsOffset ( plugin . add (
148146 plugin . newDate ( inst . drawDate ) , - inst . options . monthsToJump , 'm' ) , inst ) , 1 ) ; } ,
@@ -153,9 +151,8 @@ $.extend(Datepicker.prototype, {
153151 keystroke : { keyCode : 34 } , // Page down
154152 enabled : function ( inst ) {
155153 var maxDate = inst . get ( 'maxDate' ) ;
156- return ( ! maxDate || plugin . day ( plugin . _applyMonthsOffset ( plugin . add (
157- plugin . newDate ( inst . drawDate ) , inst . options . monthsToStep , 'm' ) , inst ) , 1 ) .
158- getTime ( ) <= maxDate . getTime ( ) ) ; } ,
154+ var date = plugin . day ( plugin . _applyMonthsOffset ( plugin . add ( plugin . newDate ( inst . drawDate ) , inst . options . monthsToStep , 'm' ) , inst ) , 1 ) ;
155+ return ( ! maxDate || ( date . getFullYear ( ) * 100 ) + date . getMonth ( ) < ( maxDate . getFullYear ( ) * 100 ) + maxDate . getMonth ( ) ) ; } ,
159156 date : function ( inst ) {
160157 return plugin . day ( plugin . _applyMonthsOffset ( plugin . add (
161158 plugin . newDate ( inst . drawDate ) , inst . options . monthsToStep , 'm' ) , inst ) , 1 ) ; } ,
@@ -1759,7 +1756,8 @@ $.extend(Datepicker.prototype, {
17591756
17601757 months += this . _generateMonth ( target , inst , drawDate . getFullYear ( ) ,
17611758 monthToGenerate , inst . options . renderer , ( row == 0 && col == 0 ) ) ;
1762- plugin . add ( drawDate , 1 , 'm' ) ;
1759+
1760+ plugin . add ( drawDate , 1 , 'm' ) ;
17631761 }
17641762 monthRows += this . _prepare ( inst . options . renderer . monthRow , inst ) . replace ( / \{ m o n t h s \} / , months ) ;
17651763 }
0 commit comments