Hello.
So here is an example of what I need. I don’t know if it is possible to do it, so that’s why I’m curious if someone can help me with it.
Imagine I have a task in between the following dates: 2024-09-01 and 2024-09-15.
And we are already on day 20 and the progress of this task didn’t go up from 0 to 1, so is not complete.
Is there a way to paint in red all the blocks of day between 2024-09-16 and today. Indicating that the task isn’t finish and to alert people (visually) to that task?
I hope it is not too confusing what I just said.
Hello,
You can achieve this using the timeline_cell_class
template. It allows you to apply custom styles to specific time cells:
gantt.templates.timeline_cell_class = (task, date) => {
if (task.progress < 1) {
const endDate = task.end_date;
if (date >= endDate && date <= new Date()) {
return 'overdue';
}
}
return '';
};
CSS styles:
.overdue {
background-color: red;
}
Here is an example: DHTMLX Snippet Tool
Does this look like what you wanted?