File tree 1 file changed +11
-1
lines changed
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) {
1017
1017
var inst = this . _getInst ( $ ( id ) [ 0 ] ) ,
1018
1018
$dp = inst . dpDiv ;
1019
1019
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 ) ;
1021
1031
$ ( '.ui-datepicker-today' , $dp ) . click ( ) ;
1022
1032
} ;
1023
1033
You can’t perform that action at this time.
0 commit comments