Month view

How is it possible to make the month displaying only events of the month ?
Now if the first day of the month is not the first day of the week (and the same for the end of the month) it display the last day (with its events) of the previous month.

That’s make a problem for me because i have to know the total duration of all event of the month.
But now i use this code to have it :

var evs = scheduler.getEvents(scheduler.getState().min_date,scheduler.getState().max_date); var duration=0; var format=scheduler.date.date_to_str("%m/%d/%Y %H:%i:%s"); for (var i=0; i<evs.length; i++) { var start=new Date(format(evs[i].start_date)); var end=new Date(format(evs[i].end_date)); var evs_duree=(end.getTime()-start.getTime())/1000/60/60; duration=duration+evs_duree; }
But it count all the events that are displayed.
So the total duration of the month is false.

Hello,

you could define a filter for the month view, so it will show only needed events.
docs.dhtmlx.com/scheduler/filtering.html

The code might look like following[code]var start = 0,
end = 0;

scheduler.attachEvent(“onBeforeViewChange”, function(oldmode, olddate, mode, date){
start = scheduler.date.month_start(new Date(date));//month_start modifies the argument, so making a copy
end = scheduler.date.add(start, 1, “month”);
return true;
});

scheduler.filter_month = function(id){
var ev = scheduler.getEvent(id);
return (+ev.end_date > +start && +ev.start_date < +end);
};[/code]

Thanks
It works but the recurring events are still displayed