diff options
author | Jun Omae <jun66j5@gmail.com> | 2011-08-15 15:52:36 +0900 |
---|---|---|
committer | Jun Omae <jun66j5@gmail.com> | 2011-08-15 15:52:36 +0900 |
commit | 97990e9657967b13a00bf7b1afa238fff9d78f61 (patch) | |
tree | c07a943779ca76f3ca0ce2814f5bed594169a310 /jquery-ui-timepicker-addon.js | |
parent | 195be63853a6be20fb50054ece23f738e0b93a3e (diff) | |
parent | 00a2cad13b541086bb5ce1bc53772e00ef16ba27 (diff) | |
download | jQuery-Timepicker-Addon-97990e9657967b13a00bf7b1afa238fff9d78f61.zip jQuery-Timepicker-Addon-97990e9657967b13a00bf7b1afa238fff9d78f61.tar.gz jQuery-Timepicker-Addon-97990e9657967b13a00bf7b1afa238fff9d78f61.tar.bz2 |
Merge remote-tracking branch 'trentrichardson/dev' into l10n-ampm
Diffstat (limited to 'jquery-ui-timepicker-addon.js')
-rw-r--r-- | jquery-ui-timepicker-addon.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js index 2e25b6d..e3b68c7 100644 --- a/jquery-ui-timepicker-addon.js +++ b/jquery-ui-timepicker-addon.js @@ -1017,7 +1017,17 @@ $.datepicker._gotoToday = function(id) { var inst = this._getInst($(id)[0]), $dp = inst.dpDiv; this._base_gotoToday(id); - this._setTime(this._getInst($(id)[0]), new Date()); + var now = new Date(); + var tp_inst = this._get(inst, 'timepicker'); + if (tp_inst._defaults.showTimezone && tp_inst.timezone_select) { + var tzoffset = now.getTimezoneOffset(); // If +0100, returns -60 + var tzsign = tzoffset > 0 ? '-' : '+'; + tzoffset = Math.abs(tzoffset); + var tzmin = tzoffset % 60 + tzoffset = tzsign + ('0' + (tzoffset - tzmin) / 60).slice(-2) + ('0' + tzmin).slice(-2); + tp_inst.timezone_select.val(tzoffset); + } + this._setTime(inst, now); $( '.ui-datepicker-today', $dp).click(); }; |