month_day-template...

I would like to show week-numbers on the first day of a week in the month-view.
Found out that it is possible to re-define the header and did the following:

scheduler.templates.month_day = function (date) { return "<span style='float:left;'> + date.getKW() . "</span><span style='float:right;'>" + scheduler.date.date_to_str(scheduler.config.month_day) + "</span>"; }

(based on docs.dhtmlx.com/scheduler/api__s … plate.html, getKW is a function that computes the weekno).

I have check several times and could not see a problem in the code which should simply extend the month_day_template-thingy, but when I run this code, I get the correct weekno plus text-output "function anonymous (date) {return “” + scheduler.date.to_fixed(date.getDate()) + “”;}. Where’s the problem???

Thanks

Michael

I fixed this by replacing scheduler.date.date_to_str(scheduler.config.month_day) with date.getDate(); - works fine. But unfortunately this gets also applied to the Year-View which would need at least a different formatting…
Is there a way in my templates code to distinguish whether the template is used to render a day for a month-view or year-view???

sure, you can get the view which is active when template is called:[code]scheduler.templates.month_day = function(date){
var mode = scheduler.getState().mode;
if(mode == “month”){

}else{

}

}[/code]

docs.dhtmlx.com/scheduler/api__s … state.html

Ok, great - thanks a lot! :slight_smile: