Set datepicker date from field before returning date for getDate method (Fixes Issue 44)

This commit is contained in:
doublerebel 2010-12-05 14:47:07 -08:00
parent 3ca9079892
commit aef1408c87

View file

@ -728,10 +728,15 @@ $.datepicker._base_getDateDatepicker = $.datepicker._getDateDatepicker;
$.datepicker._getDateDatepicker = function(target, noDefault) { $.datepicker._getDateDatepicker = function(target, noDefault) {
var inst = this._getInst(target), var inst = this._getInst(target),
tp_inst = this._get(inst, 'timepicker'); 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() == '')) ? return (!inst.currentYear || (inst.input && inst.input.val() == '')) ?
null : 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); else return this._base_getDateDatepicker(inst);
}; };