MarkTimespan with custom text inside

We want to extend the markTimespan object so we can put text to indicate to the user what the marked timespan is for (eg lunch break, meetings, business hours, …).

How can we add a field and change the html (template?) for rendering a timespan?

Hello @Jan_Gils,

You can change the HTML content of the timespan with the html property:

scheduler.addMarkedTimespan({  
    days:  5,
    zones: "fullday",
    css:   "gray_section",
    type:  "dhx_time_block",
    html:`<b>${textVariable}</b>`
});

If you need to make it more dynamic, you can pass a variable with the backticks’ syntax.

Here is a demo:
https://snippet.dhtmlx.com/dqpaza6s