Ticket #3191 (closed enhancement: fixed)
NaN causes breakage
|Reported by:||sorpigal||Owned by:||grabanski|
A bug in my options builder code resulted in defaultDate being set to NaN. Don't ask, not important. The result of this was the datepicker showing the prev/next header, the month/year dropdowns and the day of week labels, but no grid of days. After fixing my code I decided that this is probably a bug in the datepicker, too, and that a NaN default date should be treated like a null default date. I replaced the final statement in _determineDate with this:
return (isNaN(date) ? defaultDate :
(date == null ? defaultDate : (typeof date == 'string' ? offsetString(date, this._getDaysInMonth) :
(typeof date == 'number' ? offsetNumeric(date) : date))));
Which does what I want. You could argue also that this is not a bug and the developer should not make the mistake. If so, perhaps some kind of error should be thrown to indicate that this value will not work. Allowing it to silently break is not good.