Bug in Popup Calendar

There’s a bug in the calendar when it attached to a text field and using the isMonthEditable:true constructor setting. Here’s how to replicate the bug:

  1. Set the date to January 30th or January 31st (year doesn’t seem to matter).
  2. Close the calendar popup.
  3. Click the text field to pop up the calendar.
  4. Select the month from the month dropdown to February. The month will set itself to March rather than February.
  5. If you select the month again to February it seems to stick this time.

Bug is quite repeatable but only occurs the first time you select the month from the dropdown after the calendar pops.

Further to this, it appears to be linked to the number of days in February. The bug occurs when the initial date is set to 29th-31st of January in 2011, but when the year is set to 2012 it only occurs on 30th and 31st. Of course there are 28 days in February this year and 29 days next year.

We have reproduced the problem and fixed it. Please try to use attached file instead of original dhtmlxcalendar.js
dhtmlxcalendar.min.zip (9.06 KB)

Thank you for your prompt action, your fix works perfectly.