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 @@ -1017,7 +1017,17 @@ $.datepicker._gotoToday = function(id) {
10171017 var inst = this . _getInst ( $ ( id ) [ 0 ] ) ,
10181018 $dp = inst . dpDiv ;
10191019 this . _base_gotoToday ( id ) ;
1020- this . _setTime ( this . _getInst ( $ ( id ) [ 0 ] ) , new Date ( ) ) ;
1020+ var now = new Date ( ) ;
1021+ var tp_inst = this . _get ( inst , 'timepicker' ) ;
1022+ if ( tp_inst . _defaults . showTimezone && tp_inst . timezone_select ) {
1023+ var tzoffset = now . getTimezoneOffset ( ) ; // If +0100, returns -60
1024+ var tzsign = tzoffset > 0 ? '-' : '+' ;
1025+ tzoffset = Math . abs ( tzoffset ) ;
1026+ var tzmin = tzoffset % 60
1027+ tzoffset = tzsign + ( '0' + ( tzoffset - tzmin ) / 60 ) . slice ( - 2 ) + ( '0' + tzmin ) . slice ( - 2 ) ;
1028+ tp_inst . timezone_select . val ( tzoffset ) ;
1029+ }
1030+ this . _setTime ( inst , now ) ;
10211031 $ ( '.ui-datepicker-today' , $dp ) . click ( ) ;
10221032} ;
10231033
You can’t perform that action at this time.
0 commit comments