Skip to content

Commit 35cdf9a

Browse files
committed
Fix so altField for timepicker mode also show time if altField is set
1 parent 2ec0a4e commit 35cdf9a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

jquery-ui-timepicker-addon.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,8 +516,12 @@ $.extend(Timepicker.prototype, {
516516
if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0))
517517
return;
518518

519-
if (this._defaults.timeOnly === true) formattedDateTime = this.formattedTime;
520-
else if (this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) {
519+
if (this._defaults.timeOnly === true) {
520+
formattedDateTime = this.formattedTime;
521+
if (this.$altInput) {
522+
this.$altInput.val(this.formattedDateTime);
523+
}
524+
} else if (this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) {
521525
if (this.$altInput) {
522526
if (this._defaults.timeOnly !== true) {
523527
this.$altInput.val(this.$altInput.val() + ' ' + this.formattedTime);

0 commit comments

Comments
 (0)