Searched from the forum and found someone mentioned onMonthChange event. But I can not find it anywhere in the document or examples. Does anyone know if there is this kind of event? I want to show different available days for different months.
But “onChange” event does nothing when the month or year changes. The event is only triggered when you actually choose a date, is it?
I’d like to find a way that I can show calendars differently for different month. For example, for fall term(Sept. to Dec.) open dates for Mondays and Fridays only. And for winter term, open dates for Mondays to Fridays only. Now myCalendar.disableDays can only setup once. It’s not dynamic according to the months.
calendar = new dhtmlXCalendarObject("calendarHere");
calendar.setDateFormat("%m/%d/%Y");
calendar.hideTime();
calendar.show();
calendar.attachEvent("onChange",function(date, state){
alert(calendar.getFormatedDate("%n", date));
});
You can catch the month: you can get formatted date and use your custom checking.
Please, try attached sample with the latest calendar version from the site. It works fine locally. If you have incorrect behaviour - you have some problems locally. I.e. with local server. It is quite hard to assume what it can be. dhtmlxCalendar.rar (44.2 KB)