Fixed 3191 NaN causes breakage for relative dates

This commit is contained in:
Keith Wood 2008-08-21 09:25:20 +00:00
parent 426c5e1fc7
commit c5635d6350

View File

@ -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. */