Added change by mikedeco in _onTimeChange. Assures that hour, minute, second is numeric
This commit is contained in:
parent
3d53741ca4
commit
895d27f1de
9
jquery-ui-timepicker-addon.js
vendored
9
jquery-ui-timepicker-addon.js
vendored
|
@ -524,8 +524,13 @@ $.extend(Timepicker.prototype, {
|
||||||
_onTimeChange: function() {
|
_onTimeChange: function() {
|
||||||
var hour = (this.hour_slider) ? this.hour_slider.slider('value') : false,
|
var hour = (this.hour_slider) ? this.hour_slider.slider('value') : false,
|
||||||
minute = (this.minute_slider) ? this.minute_slider.slider('value') : false,
|
minute = (this.minute_slider) ? this.minute_slider.slider('value') : false,
|
||||||
second = (this.second_slider) ? this.second_slider.slider('value') : false,
|
second = (this.second_slider) ? this.second_slider.slider('value') : false;
|
||||||
ampm = (hour < 12) ? 'AM' : 'PM';
|
|
||||||
|
if (hour) hour = parseFloat(hour).toFixed(0);
|
||||||
|
if (minute) minute = parseFloat(minute).toFixed(0);
|
||||||
|
if (second) second = parseFloat(second).toFixed(0);
|
||||||
|
|
||||||
|
var ampm = (hour < 12) ? 'AM' : 'PM';
|
||||||
|
|
||||||
// If the update was done in the input field, the input field should not be updated.
|
// If the update was done in the input field, the input field should not be updated.
|
||||||
// If the update was done using the sliders, update the input field.
|
// If the update was done using the sliders, update the input field.
|
||||||
|
|
Loading…
Reference in a new issue