diff options
author | kdeng <dkf_genius@hotmail.com> | 2012-06-27 12:33:04 +1200 |
---|---|---|
committer | kdeng <dkf_genius@hotmail.com> | 2012-06-27 12:33:04 +1200 |
commit | ee59b4cf98285704c779894df30e07f07b4f6079 (patch) | |
tree | 782916a435b95a1d9c866cb70b3f1460c475a814 | |
parent | a64f781d36a52224c47b98041bf2bfb3d20ac312 (diff) | |
download | jQuery-Timepicker-Addon-ee59b4cf98285704c779894df30e07f07b4f6079.zip jQuery-Timepicker-Addon-ee59b4cf98285704c779894df30e07f07b4f6079.tar.gz jQuery-Timepicker-Addon-ee59b4cf98285704c779894df30e07f07b4f6079.tar.bz2 |
fixed a bug. When the input field is empty, and the date picker will never update it with the newly selected value
-rw-r--r-- | jquery-ui-timepicker-addon.js | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/jquery-ui-timepicker-addon.js b/jquery-ui-timepicker-addon.js index 328ad18..828ccff 100644 --- a/jquery-ui-timepicker-addon.js +++ b/jquery-ui-timepicker-addon.js @@ -827,9 +827,12 @@ $.extend(Timepicker.prototype, { timeAvailable = dt !== null && this.timeDefined; this.formattedDate = $.datepicker.formatDate(dateFmt, (dt === null ? new Date() : dt), formatCfg); var formattedDateTime = this.formattedDate; - if (dp_inst.lastVal !== undefined && (dp_inst.lastVal.length > 0 && this.$input.val().length === 0)) { - return; - } + // 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; |