Hi @Osensnolf,
I’m sorry for such a long delay. Unfortunately, there is no built-in method to change the rendering of the Month view. But you can redefine some internal functions.
First of all, you should set a start
and end
date for your view:
var getViewEnd = scheduler._get_view_end;
scheduler._get_view_end = function(){
if(scheduler.getState().mode !== "month"){
return getViewEnd.apply(this, arguments);
}
var dd = this._get_timeunit_start();
return scheduler.date.add(dd, 1, "week");
};
var getViewStart = scheduler._get_timeunit_start;
scheduler._get_timeunit_start = function(){
if(scheduler.getState().mode !== "month"){
return getViewStart.apply(this, arguments);
}
return this.date.week_start(new Date(scheduler.getState().date));
};
Then, please, redefine the behavior of the next
/previous
buttons:
var nextBtn = scheduler._click.dhx_cal_next_button;
scheduler._click.dhx_cal_next_button = function(dummy,step){
if(scheduler.getState().mode === "month"){
scheduler.setCurrentView(scheduler.date.add(
scheduler.date.week_start(new Date(scheduler._date)),(step||1),"week"));
}else{
nextBtn.apply(this, arguments);
}
}
And finally, change the way of rendering the month scale (display only one week):
var resetMonthScale = scheduler._reset_month_scale;
scheduler._reset_month_scale = function (b, dd, sd, rows) {
return resetMonthScale.apply(this, [b, dd, sd, 1]);
};
You can see the implementation of this way in the sample below:
http://snippet.dhtmlx.com/5/fd8e76119
Please, note, if you update the scheduler the app can stop working.