From c5635d6350a64ed62b5770b5a46eb5623c34fc9d Mon Sep 17 00:00:00 2001 From: Keith Wood Date: Thu, 21 Aug 2008 09:25:20 +0000 Subject: Fixed 3191 NaN causes breakage for relative dates --- ui/ui.datepicker.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'ui') 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. */ -- cgit v1.2.3