Block Days in month View

Hi,
In my Scheduler I want to shadow the certain blocked days but it only blocks the month_body without shadowing the header of the month cell , and I reached how to shadow the header of the cell but it shadows all the scheduler cells not only the blocked ones , How can I block days in month view and shadow the cell (body and head)
Thanks


Hello,
although marked timespan highlights only month body, you can define template function for a css class of a month header. In the template you can check whether the day contains blocked time, and if so - add certain css class to it.
JS, assign css class if some time of day is blocked:scheduler.templates.month_date_class = function(date){ if(scheduler.checkInMarkedTimespan({ start_date:date, end_date:scheduler.date.add(date, scheduler.config.time_step, 'minute')})){ return "blocked_day"; } return ""; };
CSS, set bg color to blocked day header:.blocked_day .dhx_month_head{ background-color: gray; opacity: 0.5; }
docs.dhtmlx.com/scheduler/api__s … espan.html
docs.dhtmlx.com/scheduler/api__s … plate.html

When I add this code in js file it hides the whole schedule and the error is ‘scheduler.checkInMarkedTimespan is not a function’

Hi,
you can define all custom JS code that is related to scheduler initialization in a function, and place it on the page or in your custom js file:
JS:

function configure() { scheduler.attachEvent("onTemplatesReady", function () { scheduler.templates.month_date_class = function (date) { if (scheduler.checkInMarkedTimespan({ start_date: date, end_date: scheduler.date.add(date, scheduler.config.time_step, 'minute') })) { return "blocked_day"; } return ""; }; }); }
Then add it to scheduler with following code
C#: scheduler.BeforeInit.Add("configure()");
Make sure ‘configure’ function is defined before scheduler is initialized(i.e. abowe DHXScheduler.Render() in a page markup)

scheduler-net.com/docs/options_a … n_the_page