File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -989,7 +989,17 @@ $.datepicker._gotoToday = function(id) {
989989 var inst = this . _getInst ( $ ( id ) [ 0 ] ) ,
990990 $dp = inst . dpDiv ;
991991 this . _base_gotoToday ( id ) ;
992- this . _setTime ( this . _getInst ( $ ( id ) [ 0 ] ) , new Date ( ) ) ;
992+ var now = new Date ( ) ;
993+ var tp_inst = this . _get ( inst , 'timepicker' ) ;
994+ if ( tp_inst . _defaults . showTimezone && tp_inst . timezone_select ) {
995+ var tzoffset = now . getTimezoneOffset ( ) ; // If +0100, returns -60
996+ var tzsign = tzoffset > 0 ? '-' : '+' ;
997+ tzoffset = Math . abs ( tzoffset ) ;
998+ var tzmin = tzoffset % 60
999+ tzoffset = tzsign + ( '0' + ( tzoffset - tzmin ) / 60 ) . slice ( - 2 ) + ( '0' + tzmin ) . slice ( - 2 ) ;
1000+ tp_inst . timezone_select . val ( tzoffset ) ;
1001+ }
1002+ this . _setTime ( inst , now ) ;
9931003 $ ( '.ui-datepicker-today' , $dp ) . click ( ) ;
9941004} ;
9951005
You can’t perform that action at this time.
0 commit comments