summaryrefslogtreecommitdiffstats
path: root/jquery-ui-timepicker-addon.js
diff options
context:
space:
mode:
authorJun Omae <jun66j5@gmail.com>2011-08-12 22:51:24 +0900
committerJun Omae <jun66j5@gmail.com>2011-08-12 22:51:24 +0900
commitceabba803d465059bc7de267737bec03492387c1 (patch)
tree28f735d012e5edf5e13a46db7bc868caffea7e3e /jquery-ui-timepicker-addon.js
parent6737b60eee2ac9d2b698c62a2bf036a5af183c00 (diff)
parent8507859312748e39f84f609a61d7894718ca6db0 (diff)
downloadjQuery-Timepicker-Addon-ceabba803d465059bc7de267737bec03492387c1.zip
jQuery-Timepicker-Addon-ceabba803d465059bc7de267737bec03492387c1.tar.gz
jQuery-Timepicker-Addon-ceabba803d465059bc7de267737bec03492387c1.tar.bz2
Merge remote-tracking branch 'trentrichardson/dev' into iso8601-tz
Diffstat (limited to 'jquery-ui-timepicker-addon.js')
-rw-r--r--jquery-ui-timepicker-addon.js12
1 files changed, 11 insertions, 1 deletions
diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js
index 573e5be..f15f27d 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();
};