summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrent Richardson <trentdrichardson@gmail.com>2012-07-26 09:24:31 -0400
committerTrent Richardson <trentdrichardson@gmail.com>2012-07-26 09:24:31 -0400
commit3de1c5e4a502996af096dd081bc817c5b9bcafd9 (patch)
treeae46784d106cb95d17143ce292b818c7803528b6
parent8b95f20fecc87b63b543536b962dce5972f87e4f (diff)
downloadjQuery-Timepicker-Addon-3de1c5e4a502996af096dd081bc817c5b9bcafd9.zip
jQuery-Timepicker-Addon-3de1c5e4a502996af096dd081bc817c5b9bcafd9.tar.gz
jQuery-Timepicker-Addon-3de1c5e4a502996af096dd081bc817c5b9bcafd9.tar.bz2
Fixes #391 - Selecting input populates the date when empty
-rw-r--r--jquery-ui-timepicker-addon.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js
index be94d14..1f0c7b0 100644
--- a/jquery-ui-timepicker-addon.js
+++ b/jquery-ui-timepicker-addon.js
@@ -773,7 +773,7 @@ $.extend(Timepicker.prototype, {
second != this.second || millisec != this.millisec ||
(this.ampm.length > 0 &&
(hour < 12) != ($.inArray(this.ampm.toUpperCase(), this.amNames) !== -1)) ||
- timezone != this.timezone);
+ ((this.timezone == null && timezone != this.defaultTimezone) || (this.timezone != null && timezone != this.timezone)));
if (hasChanged) {
@@ -832,12 +832,13 @@ $.extend(Timepicker.prototype, {
timeAvailable = dt !== null && this.timeDefined;
this.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg);
var formattedDateTime = this.formattedDate;
+
// remove following lines to force every changes in date picker to change the input value
// Bug descriptions: when an input field has a default value, and click on the field to pop up the date picker.
// If the user manually empty the value in the input field, the date picker will never change selected value.
//if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0)) {
// return;
- //}
+ //}
if (this._defaults.timeOnly === true) {
formattedDateTime = this.formattedTime;