Changing color of blocked timeslots

Good day,

Is there a way to change the color of blocked time/timeslots, so that users can immediately see which areas of the scheduler they can’t clicked?


Check blockTime api … s_limiting

You can change the look of blocked slots through css ( div.dhx_time_block )

Good day,

I tried this, but it seems that the color is not evident on load. It would only show up, like in Chrome, when I do an ‘Inspect element’ on the scheduler, then the scheduler changes color.

background-color: #8B0000 !important;


Be sure that blocks with custom styles placed before scheduler rendering.
It works correctly in local tests.

Sorry, I don’t understand. Can you give an example? Thank you very much.
Also, without adding our custom styles, it seems that the default is that the blocked time should be grayed out. But it also is not working. :frowning:

Check the attached sample (54.4 KB)

Thank you very much. From the sample, it seems that the blocktime() is called before init. But we have to get the blocked timeslots from the server everytime the user changes the view/date.

Already figured this out, but is there a way to block the timeslots asynchronously?


Simply refresh the view after adding blocked times -

Kind regards,

You can use blockTime in any moment, just call after it

scheduler.setCurrentView(scheduler.getState().date, scheduler.getState().mode);

to force re-rendering of view.