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 @@ -989,7 +989,17 @@ $.datepicker._gotoToday = function(id) {
989
989
var inst = this . _getInst ( $ ( id ) [ 0 ] ) ,
990
990
$dp = inst . dpDiv ;
991
991
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 ) ;
993
1003
$ ( '.ui-datepicker-today' , $dp ) . click ( ) ;
994
1004
} ;
995
1005
You can’t perform that action at this time.
0 commit comments