diff options
author | Trent Richardson <trentdrichardson@gmail.com> | 2010-11-18 14:45:26 -0500 |
---|---|---|
committer | Trent Richardson <trentdrichardson@gmail.com> | 2010-11-18 14:45:26 -0500 |
commit | 92f1508c68b45d377c71974081ecdc03aa0a4e6e (patch) | |
tree | 462b42ca88aaa0743d2eec0d9a49bd3b54f35f6c /jquery-ui-timepicker-addon.js | |
parent | 48f17b1f714586e7f5af903a0048d91de84af6ce (diff) | |
download | jQuery-Timepicker-Addon-92f1508c68b45d377c71974081ecdc03aa0a4e6e.zip jQuery-Timepicker-Addon-92f1508c68b45d377c71974081ecdc03aa0a4e6e.tar.gz jQuery-Timepicker-Addon-92f1508c68b45d377c71974081ecdc03aa0a4e6e.tar.bz2 |
Fixed daylight savings bug i think
Diffstat (limited to 'jquery-ui-timepicker-addon.js')
-rw-r--r-- | jquery-ui-timepicker-addon.js | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js index 84933fd..cea3e01 100644 --- a/jquery-ui-timepicker-addon.js +++ b/jquery-ui-timepicker-addon.js @@ -676,6 +676,15 @@ $.datepicker._setTime = function(inst, date) { }; //####################################################################################### +// datepicker doesn't care about hours.. we do.. leave dp alone this time.. +//####################################################################################### +$.datepicker._daylightSavingAdjustDateTime = function(date) { + if (!date) return null; + date.setHours(date.getHours() > 12 ? date.getHours() + 2 : date.getHours()); + return date; +}; + +//####################################################################################### // override setDate() to allow getting time too within Date object //####################################################################################### $.datepicker._base_setDate = $.datepicker._setDate; @@ -698,7 +707,7 @@ $.datepicker._getDate = function(inst) { if (tp_inst) return startDate = (!inst.currentYear || (inst.input && inst.input.val() == '')) ? null : - this._daylightSavingAdjust(new Date(inst.currentYear, inst.currentMonth, inst.currentDay, tp_inst.hour, tp_inst.minute, tp_inst.second)); + this._daylightSavingAdjustDateTime(new Date(inst.currentYear, inst.currentMonth, inst.currentDay, tp_inst.hour, tp_inst.minute, tp_inst.second)); else return $.datepicker._base_getDate(inst); }; |