Skip to content

Commit 7e99584

Browse files
Issue 441 - added better constraint to setting time from field
1 parent df505b9 commit 7e99584

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

jquery-ui-timepicker-addon.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1405,7 +1405,11 @@
14051405
var tp_inst = this._get(inst, 'timepicker');
14061406

14071407
if (tp_inst) {
1408-
//this._setDateFromField(inst, noDefault); // This keeps setting to today when it shouldn't
1408+
// if it hasn't yet been defined, grab from field
1409+
if(inst.lastVal === undefined){
1410+
this._setDateFromField(inst, noDefault);
1411+
}
1412+
14091413
var date = this._getDate(inst);
14101414
if (date && tp_inst._parseTime($(target).val(), tp_inst.timeOnly)) {
14111415
date.setHours(tp_inst.hour, tp_inst.minute, tp_inst.second, tp_inst.millisec);

0 commit comments

Comments
 (0)