@@ -569,7 +569,7 @@ $.extend(Timepicker.prototype, {
569
569
this . _defaults . minuteMax = maxDateTime . getMinutes ( ) ;
570
570
if ( this . minute >= this . _defaults . minuteMax ) {
571
571
this . minute = this . _defaults . minuteMax ;
572
- this . _defaults . secondMin = maxDateTime . getSeconds ( ) ;
572
+ this . _defaults . secondMax = maxDateTime . getSeconds ( ) ;
573
573
} else {
574
574
if ( this . second > this . _defaults . secondMax ) this . second = this . _defaults . secondMax ;
575
575
this . _defaults . secondMax = this . secondMaxOriginal ;
@@ -586,9 +586,13 @@ $.extend(Timepicker.prototype, {
586
586
}
587
587
588
588
if ( adjustSliders !== undefined && adjustSliders === true ) {
589
- this . hour_slider . slider ( "option" , { min : this . _defaults . hourMin , max : this . _defaults . hourMax } ) . slider ( 'value' , this . hour ) ;
590
- this . minute_slider . slider ( "option" , { min : this . _defaults . minuteMin , max : this . _defaults . minuteMax } ) . slider ( 'value' , this . minute ) ;
591
- this . second_slider . slider ( "option" , { min : this . _defaults . secondMin , max : this . _defaults . secondMax } ) . slider ( 'value' , this . second ) ;
589
+ var hourMax = ( this . _defaults . hourMax - ( this . _defaults . hourMax % this . _defaults . stepHour ) ) . toFixed ( 0 ) ,
590
+ minMax = ( this . _defaults . minuteMax - ( this . _defaults . minuteMax % this . _defaults . stepMinute ) ) . toFixed ( 0 ) ,
591
+ secMax = ( this . _defaults . secondMax - ( this . _defaults . secondMax % this . _defaults . stepSecond ) ) . toFixed ( 0 ) ;
592
+
593
+ this . hour_slider . slider ( "option" , { min : this . _defaults . hourMin , max : hourMax } ) . slider ( 'value' , this . hour ) ;
594
+ this . minute_slider . slider ( "option" , { min : this . _defaults . minuteMin , max : minMax } ) . slider ( 'value' , this . minute ) ;
595
+ this . second_slider . slider ( "option" , { min : this . _defaults . secondMin , max : secMax } ) . slider ( 'value' , this . second ) ;
592
596
}
593
597
594
598
} ,
0 commit comments