Skip to content

Commit ba22e24

Browse files
trentrichardson#583 altField not honoring timeOnly=true
1 parent 3cf20b3 commit ba22e24

File tree

1 file changed

+12
-10
lines changed

1 file changed

+12
-10
lines changed

jquery-ui-timepicker-addon.js

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -857,24 +857,26 @@
857857

858858
if (!this._defaults.showTimepicker) {
859859
this.$input.val(this.formattedDate);
860-
} else if (this.$altInput && this._defaults.altFieldTimeOnly === true) {
860+
} else if (this.$altInput && this._defaults.timeOnly === false && this._defaults.altFieldTimeOnly === true) {
861861
this.$altInput.val(this.formattedTime);
862862
this.$input.val(this.formattedDate);
863863
} else if (this.$altInput) {
864864
this.$input.val(formattedDateTime);
865865
var altFormattedDateTime = '',
866866
altSeparator = this._defaults.altSeparator ? this._defaults.altSeparator : this._defaults.separator,
867867
altTimeSuffix = this._defaults.altTimeSuffix ? this._defaults.altTimeSuffix : this._defaults.timeSuffix;
868+
869+
if(!this._defaults.timeOnly){
870+
if (this._defaults.altFormat){
871+
altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, (dt === null ? new Date() : dt), formatCfg);
872+
}
873+
else{
874+
altFormattedDateTime = this.formattedDate;
875+
}
868876

869-
if (this._defaults.altFormat){
870-
altFormattedDateTime = $.datepicker.formatDate(this._defaults.altFormat, (dt === null ? new Date() : dt), formatCfg);
871-
}
872-
else{
873-
altFormattedDateTime = this.formattedDate;
874-
}
875-
876-
if (altFormattedDateTime){
877-
altFormattedDateTime += altSeparator;
877+
if (altFormattedDateTime){
878+
altFormattedDateTime += altSeparator;
879+
}
878880
}
879881

880882
if(this._defaults.altTimeFormat){

0 commit comments

Comments
 (0)