Calender recognices weekends as sensitives

Hello All!

I am crossposting from a thread in developing some frontend for getting free dates in scheduler.
Via this, i am experimenting with Calendar. First i uses jQuery at the frontend, but the possibility to define sensitive Date-Ranges is much better in dhtmlx, so i decided to do the switch also in frontend :slight_smile:

But now i need a little help because i can’t find a way to block all weekends (saturday+sunday) via an algorythm. Of cours ei could notice every days and define it via setSensitive, but this i not what i would preffer :wink:

Could someone give me a clue how to get them all?

Another thing is, that i took quite 2 hours (!) to define, that all dates BEFORE today should be inactive… I think this code should be in the samples or documents, don’t you think so? :slight_smile:
I solved it like this (with php, but also can do it with JS…)

mCal.setSensitive(new Date('<?=date("M d Y");?>'), null);

Hello,

But now i need a little help because i can’t find a way to block all weekends (saturday+sunday) via an algorythm.

var temp = new Date(); calendar.attachEvent("onClick",function(date){ if(date.getDay()==0||date.getDay()==6) calendar.setDate(temp); else temp = date; });

all dates BEFORE today should be inactive… I think this code should be in the samples or documents, don’t you think so?

Yes, you are right. We have added this information to the method description:
docs.dhtmlx.com/doku.php?id=dhtm … tsensitive