Merge pull request #284 from RichardBradley/dev
Fix error parsing date when setting option defaultDate
This commit is contained in:
commit
1a1526287a
1 changed files with 9 additions and 4 deletions
13
jquery-ui-timepicker-addon.js
vendored
13
jquery-ui-timepicker-addon.js
vendored
|
@ -1207,10 +1207,15 @@ $.datepicker.parseDate = function(format, value, settings) {
|
|||
try {
|
||||
date = this._base_parseDate(format, value, settings);
|
||||
} catch (err) {
|
||||
// Hack! The error message ends with a colon, a space, and
|
||||
// the "extra" characters. We rely on that instead of
|
||||
// attempting to perfectly reproduce the parsing algorithm.
|
||||
date = this._base_parseDate(format, value.substring(0,value.length-(err.length-err.indexOf(':')-2)), settings);
|
||||
if (err.indexOf(":") >= 0) {
|
||||
// Hack! The error message ends with a colon, a space, and
|
||||
// the "extra" characters. We rely on that instead of
|
||||
// attempting to perfectly reproduce the parsing algorithm.
|
||||
date = this._base_parseDate(format, value.substring(0,value.length-(err.length-err.indexOf(':')-2)), settings);
|
||||
} else {
|
||||
// The underlying error was not related to the time
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
return date;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue