Skip to content

Commit 94ea439

Browse files
Fixed altField implementation
1 parent 6ae78e0 commit 94ea439

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

jquery-ui-timepicker-addon.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -472,12 +472,13 @@
472472
formattedDateTime = this.formattedTime;
473473
}
474474
else if (this.defaults.timeOnly !== true && (this.defaults.alwaysSetTime || timeAvailable)) {
475-
formattedDateTime += ' ' + this.formattedTime;
476-
}
477-
478-
if ((this.$altInput) && this.$altInput != null)
479-
{
480-
this.$altInput.val(formattedDateTime);
475+
if ((this.$altInput) && this.$altInput != null)
476+
{
477+
this.$altInput.val(this.formattedTime);
478+
}
479+
else{
480+
formattedDateTime += ' ' + this.formattedTime;
481+
}
481482
}
482483

483484
this.formattedDateTime = formattedDateTime;
@@ -518,7 +519,8 @@
518519
tp.second = tp.defaults.second;
519520
tp.ampm = '';
520521
tp.$input = $(input);
521-
tp.$altInput = $($.datepicker._get(inst, 'altField'));
522+
if(opts.altField != undefined && opts.altField != '')
523+
tp.$altInput = $($.datepicker._get(inst, 'altField'));
522524
tp.inst = inst;
523525
tp.addTimePicker(inst);
524526
if ($.isFunction(opts.beforeShow)) {

0 commit comments

Comments
 (0)