We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 04efa58 commit 5ab6e7bCopy full SHA for 5ab6e7b
jquery-ui-timepicker-addon.js
@@ -989,7 +989,17 @@ $.datepicker._gotoToday = function(id) {
989
var inst = this._getInst($(id)[0]),
990
$dp = inst.dpDiv;
991
this._base_gotoToday(id);
992
- this._setTime(this._getInst($(id)[0]), new Date());
+ var now = new Date();
993
+ var tp_inst = this._get(inst, 'timepicker');
994
+ if (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);
1003
$( '.ui-datepicker-today', $dp).click();
1004
};
1005
0 commit comments