diff options
Diffstat (limited to 'ui/ui.datepicker.js')
-rw-r--r-- | ui/ui.datepicker.js | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/ui.datepicker.js b/ui/ui.datepicker.js index d4b01a208..6c476d9f7 100644 --- a/ui/ui.datepicker.js +++ b/ui/ui.datepicker.js @@ -1244,9 +1244,10 @@ $.extend(Datepicker.prototype, { } return new Date(year, month, day); }; - return (date == null ? defaultDate : + date = (date == null ? defaultDate : (typeof date == 'string' ? offsetString(date, this._getDaysInMonth) : - (typeof date == 'number' ? offsetNumeric(date) : date))); + (typeof date == 'number' ? (isNaN(date) ? defaultDate : offsetNumeric(date)) : date))); + return (date && date.toString() == 'Invalid Date' ? defaultDate : date); }, /* Set the date(s) directly. */ |