Skip to content

Commit 2ec0a4e

Browse files
committed
Fix so altField(if set) show both Date and Time
1 parent 2781508 commit 2ec0a4e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

jquery-ui-timepicker-addon.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,13 @@ $.extend(Timepicker.prototype, {
518518

519519
if (this._defaults.timeOnly === true) formattedDateTime = this.formattedTime;
520520
else if (this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) {
521-
if (this.$altInput) this.$altInput.val(this.formattedTime);
521+
if (this.$altInput) {
522+
if (this._defaults.timeOnly !== true) {
523+
this.$altInput.val(this.$altInput.val() + ' ' + this.formattedTime);
524+
} else {
525+
this.$altInput.val(this.formattedDateTime);
526+
}
527+
}
522528
else formattedDateTime += ' ' + this.formattedTime;
523529
}
524530

0 commit comments

Comments
 (0)