onMonthChange event for dhtmlxCalendar

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.

Thanks,
Grace

Here it is:
docs.dhtmlx.com/doku.php?id=dhtm … ngemonth&s[]=onChange

Thanks Darya, but it didn’t work. I’m using dhtmlxCalendar 3.6.

Sorry, this event handlar was a long long time ago. It was already deleted.
We removed it from docs. Now you need to use “onChange” event as well.

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.

Just try it:

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.

I’m using dhtmlxCalendar v.3.6 Standard edition build 130619 and this does not work. Which version do you use?

myCalendar.attachEvent(“onChange”,function(date, state){
alert(calendar.getFormatedDate("%n", date));
});

With the one we paid (dhtmlxCalendar v.2.6 Standard edition build 100722) I found onChangeMonth event working, but not the disableDays function.

Tried with a new download verstion dhtmlxCalendar v.3.6 Standard edition build 131023, still not working.

You can upgrade your calendar version till current:
dhtmlx.com/docs/products/dht … ndex.shtml
This event works fine with it

The build 131023 I tried is the current version as indicated from the last post.

I’m really tired with this.

Could you answer my question directly? Which version did you try when you said it’s working fine?

It’s quite simple. I don’t know what’s wrong it’s working for you but not any of mine.

If it’s working for your version, could you add it into the samples page? This is link:

dhtmlx.com/docs/products/dht … hange.html

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)

Dear grace1123, what do you do to call this event? It seems like you are waiting “onChange” result from “onClick” or “onArrowClick” event…
Please, look through the next links:
docs.dhtmlx.com/doku.php?id=dhtm … t_onchange
docs.dhtmlx.com/doku.php?id=dhtm … arrowclick
docs.dhtmlx.com/doku.php?id=dhtm … nt_onclick
Your provided link work fine locally

Thanks Darya,

onArrowClick works as I needed.

Thanks,
Grace

You are welcome!