setDate Function returning wrong date

I am using the setDate function of the dhtmlxcalendar. When entering a date duing June, it is selecting the same date in July instead. Every other month seems to be ok. Any ideas?

The problem is not reconstructable with latest code - please try to use attached js file instead of existing one.

dhtmlxcalendar.zip (12 KB)