I’d like different text in my events depending on whether they’re in timeline view or month view. Unfortunately the event_bar_text template applies to both of these views. Is there any way to have different text for my events depending on the view?
Thank you
Hello @kdoronzio ,
Yes, it can be implemented with event_bar_text template and the getState method, by checking currently opened view, and returning different content for different views, like follows:
scheduler.templates.event_bar_text = function(start,end,event){
var mode = scheduler.getState().mode;
if(mode == "timeline"){
return `Time ${event.text}`;
}
else {
return `Month ${event.text}`;
}
};
Here is a demo:
https://snippet.dhtmlx.com/cjhtra6y
Kind regards,