Skip to content

Commit 330c584

Browse files
committed
workaround to get altField with date and time to work
1 parent 7b9ba9a commit 330c584

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

jquery-ui-timepicker-addon.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -834,6 +834,8 @@ $.extend(Timepicker.prototype, {
834834
// return;
835835
//}
836836

837+
var altFormat = $.datepicker._get(dp_inst, 'altFormat') || $.datepicker._get(dp_inst, 'dateFormat');
838+
837839
if (this._defaults.timeOnly === true) {
838840
formattedDateTime = this.formattedTime;
839841
} else if (this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) {
@@ -848,7 +850,7 @@ $.extend(Timepicker.prototype, {
848850
this.$altInput.val(this.formattedTime);
849851
this.$input.val(this.formattedDate);
850852
} else if(this.$altInput) {
851-
this.$altInput.val(formattedDateTime);
853+
this.$altInput.val($.datepicker.formatDate('yy-mm-dd', (dt === null ? new Date() : dt), formatCfg) + ' ' + this.formattedTime);
852854
this.$input.val(formattedDateTime);
853855
} else {
854856
this.$input.val(formattedDateTime);
@@ -1527,4 +1529,4 @@ var timeZoneString = function(date)
15271529
$.timepicker = new Timepicker(); // singleton instance
15281530
$.timepicker.version = "1.0.1";
15291531

1530-
})(jQuery);
1532+
})(jQuery);

0 commit comments

Comments
 (0)