From 330c58478cf1dcfdba546fd5f49f3a969dea3b59 Mon Sep 17 00:00:00 2001 From: Rachel Donovan Date: Thu, 19 Jul 2012 14:43:19 -0400 Subject: [PATCH] workaround to get altField with date and time to work --- jquery-ui-timepicker-addon.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js index 8d5a107..2c4adac 100644 --- a/jquery-ui-timepicker-addon.js +++ b/jquery-ui-timepicker-addon.js @@ -834,6 +834,8 @@ $.extend(Timepicker.prototype, { // return; //} + var altFormat = $.datepicker._get(dp_inst, 'altFormat') || $.datepicker._get(dp_inst, 'dateFormat'); + if (this._defaults.timeOnly === true) { formattedDateTime = this.formattedTime; } else if (this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) { @@ -848,7 +850,7 @@ $.extend(Timepicker.prototype, { this.$altInput.val(this.formattedTime); this.$input.val(this.formattedDate); } else if(this.$altInput) { - this.$altInput.val(formattedDateTime); + this.$altInput.val($.datepicker.formatDate('yy-mm-dd', (dt === null ? new Date() : dt), formatCfg) + ' ' + this.formattedTime); this.$input.val(formattedDateTime); } else { this.$input.val(formattedDateTime); @@ -1527,4 +1529,4 @@ var timeZoneString = function(date) $.timepicker = new Timepicker(); // singleton instance $.timepicker.version = "1.0.1"; -})(jQuery); +})(jQuery); \ No newline at end of file