From 2ec0a4e02120ec2a4370867924b004a8ef58dd7c Mon Sep 17 00:00:00 2001 From: "Vorapoap L." Date: Thu, 16 Dec 2010 09:07:52 -0800 Subject: [PATCH 1/3] Fix so altField(if set) show both Date and Time --- jquery-ui-timepicker-addon.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js index 11834a9..6604115 100644 --- a/jquery-ui-timepicker-addon.js +++ b/jquery-ui-timepicker-addon.js @@ -518,7 +518,13 @@ $.extend(Timepicker.prototype, { if (this._defaults.timeOnly === true) formattedDateTime = this.formattedTime; else if (this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) { - if (this.$altInput) this.$altInput.val(this.formattedTime); + if (this.$altInput) { + if (this._defaults.timeOnly !== true) { + this.$altInput.val(this.$altInput.val() + ' ' + this.formattedTime); + } else { + this.$altInput.val(this.formattedDateTime); + } + } else formattedDateTime += ' ' + this.formattedTime; } From 35cdf9add98e5f862db27c3017307c138996193d Mon Sep 17 00:00:00 2001 From: "Vorapoap L." Date: Thu, 16 Dec 2010 09:31:15 -0800 Subject: [PATCH 2/3] Fix so altField for timepicker mode also show time if altField is set --- jquery-ui-timepicker-addon.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js index 6604115..2a08013 100644 --- a/jquery-ui-timepicker-addon.js +++ b/jquery-ui-timepicker-addon.js @@ -516,8 +516,12 @@ $.extend(Timepicker.prototype, { if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0)) return; - if (this._defaults.timeOnly === true) formattedDateTime = this.formattedTime; - else if (this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) { + if (this._defaults.timeOnly === true) { + formattedDateTime = this.formattedTime; + if (this.$altInput) { + this.$altInput.val(this.formattedDateTime); + } + } else if (this._defaults.timeOnly !== true && (this._defaults.alwaysSetTime || timeAvailable)) { if (this.$altInput) { if (this._defaults.timeOnly !== true) { this.$altInput.val(this.$altInput.val() + ' ' + this.formattedTime); From 021967bd29a1e663785bc7c9c9d928447655bd96 Mon Sep 17 00:00:00 2001 From: "Vorapoap L." Date: Thu, 16 Dec 2010 09:48:25 -0800 Subject: [PATCH 3/3] Fix so DateTime value is returned to the input field correctly. --- jquery-ui-timepicker-addon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js index 2a08013..29e0b7b 100644 --- a/jquery-ui-timepicker-addon.js +++ b/jquery-ui-timepicker-addon.js @@ -529,7 +529,7 @@ $.extend(Timepicker.prototype, { this.$altInput.val(this.formattedDateTime); } } - else formattedDateTime += ' ' + this.formattedTime; + formattedDateTime += ' ' + this.formattedTime; } this.formattedDateTime = formattedDateTime;