mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Datepicker: Corrected automatic parsing of date on keystrokes
This commit is contained in:
parent
0a8392186b
commit
7c9b782ee1
5
ui/jquery.ui.datepicker.js
vendored
5
ui/jquery.ui.datepicker.js
vendored
@ -552,6 +552,7 @@ $.extend(Datepicker.prototype, {
|
|||||||
/* Synchronise manual entry and field/alternate field. */
|
/* Synchronise manual entry and field/alternate field. */
|
||||||
_doKeyUp: function(event) {
|
_doKeyUp: function(event) {
|
||||||
var inst = $.datepicker._getInst(event.target);
|
var inst = $.datepicker._getInst(event.target);
|
||||||
|
if (inst.input.val() != inst.lastVal) {
|
||||||
try {
|
try {
|
||||||
var date = $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'),
|
var date = $.datepicker.parseDate($.datepicker._get(inst, 'dateFormat'),
|
||||||
(inst.input ? inst.input.val() : null),
|
(inst.input ? inst.input.val() : null),
|
||||||
@ -565,6 +566,7 @@ $.extend(Datepicker.prototype, {
|
|||||||
catch (event) {
|
catch (event) {
|
||||||
$.datepicker.log(event);
|
$.datepicker.log(event);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -1202,7 +1204,8 @@ $.extend(Datepicker.prototype, {
|
|||||||
/* Parse existing date and initialise date picker. */
|
/* Parse existing date and initialise date picker. */
|
||||||
_setDateFromField: function(inst) {
|
_setDateFromField: function(inst) {
|
||||||
var dateFormat = this._get(inst, 'dateFormat');
|
var dateFormat = this._get(inst, 'dateFormat');
|
||||||
var dates = inst.input ? inst.input.val() : null;
|
inst.lastVal = inst.input ? inst.input.val() : null;
|
||||||
|
var dates = inst.lastVal;
|
||||||
var date, defaultDate;
|
var date, defaultDate;
|
||||||
date = defaultDate = this._getDefaultDate(inst);
|
date = defaultDate = this._getDefaultDate(inst);
|
||||||
var settings = this._getFormatConfig(inst);
|
var settings = this._getFormatConfig(inst);
|
||||||
|
Loading…
Reference in New Issue
Block a user