Fix issue #135, time was set to NaN in some rare cases
This commit is contained in:
parent
607577cefa
commit
2be272b34e
12
jquery-ui-timepicker-addon.js
vendored
12
jquery-ui-timepicker-addon.js
vendored
|
@ -608,6 +608,11 @@ $.extend(Timepicker.prototype, {
|
||||||
second = (this.second_slider) ? this.second_slider.slider('value') : false,
|
second = (this.second_slider) ? this.second_slider.slider('value') : false,
|
||||||
timezone = (this.timezone_select) ? this.timezone_select.val() : false;
|
timezone = (this.timezone_select) ? this.timezone_select.val() : false;
|
||||||
|
|
||||||
|
if (typeof(hour) == 'object') hour = false;
|
||||||
|
if (typeof(minute) == 'object') minute = false;
|
||||||
|
if (typeof(second) == 'object') second = false;
|
||||||
|
if (typeof(timezone) == 'object') timezone = false;
|
||||||
|
|
||||||
if (hour !== false) hour = parseInt(hour,10);
|
if (hour !== false) hour = parseInt(hour,10);
|
||||||
if (minute !== false) minute = parseInt(minute,10);
|
if (minute !== false) minute = parseInt(minute,10);
|
||||||
if (second !== false) second = parseInt(second,10);
|
if (second !== false) second = parseInt(second,10);
|
||||||
|
@ -909,12 +914,13 @@ $.datepicker._setTime = function(inst, date) {
|
||||||
second = defaults.secondMin;
|
second = defaults.secondMin;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tp_inst.hour = hour;
|
||||||
|
tp_inst.minute = minute;
|
||||||
|
tp_inst.second = second;
|
||||||
|
|
||||||
if (tp_inst.hour_slider) tp_inst.hour_slider.slider('value', hour);
|
if (tp_inst.hour_slider) tp_inst.hour_slider.slider('value', hour);
|
||||||
else tp_inst.hour = hour;
|
|
||||||
if (tp_inst.minute_slider) tp_inst.minute_slider.slider('value', minute);
|
if (tp_inst.minute_slider) tp_inst.minute_slider.slider('value', minute);
|
||||||
else tp_inst.minute = minute;
|
|
||||||
if (tp_inst.second_slider) tp_inst.second_slider.slider('value', second);
|
if (tp_inst.second_slider) tp_inst.second_slider.slider('value', second);
|
||||||
else tp_inst.second = second;
|
|
||||||
|
|
||||||
tp_inst._onTimeChange();
|
tp_inst._onTimeChange();
|
||||||
tp_inst._updateDateTime(inst);
|
tp_inst._updateDateTime(inst);
|
||||||
|
|
Loading…
Reference in a new issue