diff options
author | doublerebel <charles@doublerebel.com> | 2010-12-05 14:47:07 -0800 |
---|---|---|
committer | doublerebel <charles@doublerebel.com> | 2010-12-05 14:54:38 -0800 |
commit | aef1408c876440dbc00fe1abd18535bbc51e4493 (patch) | |
tree | 03a2f7f25d57b704e15fa261e4be0191e4e151f3 /jquery-ui-timepicker-addon.js | |
parent | 3ca9079892ece2a1cdfe340c327a7d8cfe4fcd6a (diff) | |
download | jQuery-Timepicker-Addon-aef1408c876440dbc00fe1abd18535bbc51e4493.zip jQuery-Timepicker-Addon-aef1408c876440dbc00fe1abd18535bbc51e4493.tar.gz jQuery-Timepicker-Addon-aef1408c876440dbc00fe1abd18535bbc51e4493.tar.bz2 |
Set datepicker date from field before returning date for getDate method (Fixes Issue 44)
Diffstat (limited to 'jquery-ui-timepicker-addon.js')
-rw-r--r-- | jquery-ui-timepicker-addon.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js index 88e7789..dad0b08 100644 --- a/jquery-ui-timepicker-addon.js +++ b/jquery-ui-timepicker-addon.js @@ -728,10 +728,15 @@ $.datepicker._base_getDateDatepicker = $.datepicker._getDateDatepicker; $.datepicker._getDateDatepicker = function(target, noDefault) { var inst = this._getInst(target), tp_inst = this._get(inst, 'timepicker'); - if (tp_inst) + + if (tp_inst) { + this._setDateFromField(inst, noDefault); + var date = this._getDate(inst); + date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second); return (!inst.currentYear || (inst.input && inst.input.val() == '')) ? null : - (new Date(inst.currentYear, inst.currentMonth, inst.currentDay, tp_inst.hour, tp_inst.minute, tp_inst.second)); + date; + } else return this._base_getDateDatepicker(inst); }; |