timcharper / calendar_date_select

A previously popular but no longer maintained JavaScript DatePicker for RubyOnRails (and others)
http://code.google.com/p/calendardateselect/
Other
409 stars 179 forks source link

When "December 10, 2010" is put in text field, javascript calendar won't popup: getFullYear is not a function #9

Open triemstr opened 14 years ago

triemstr commented 14 years ago

Discovered by Nick Murphy at Saturn Systems: http://www.saturnsys.com/

Put "December 10, 2010" in your text field that is connected to the javascript calendar. Then hit the calendar.

Get browser/js error: this.date.getFullYear is not a function

The bug is in the Date.parseFormattedString() call on line 338. It returns a non-date object for the value we're providing it (looks to be an integer).

The result isn't handled so it passes through as an error and the calendar no longer pops up in this case.

However, if you just type "garbage" in the text field, the javascript calendar continues to popup.

Version 1.16.1.