From 678fa3524391d540fd08f3669a5757dc63eba92f Mon Sep 17 00:00:00 2001 From: Trent Richardson Date: Wed, 8 Dec 2010 11:52:52 -0500 Subject: [PATCH] Fixed getDate for timepicker if not yet been opened --- jquery-ui-timepicker-addon.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js index 60b11b0..fc174a8 100644 --- a/jquery-ui-timepicker-addon.js +++ b/jquery-ui-timepicker-addon.js @@ -738,11 +738,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); + this._updateDatepicker(inst); + 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)); - + } return this._base_getDateDatepicker(target, noDefault); };