How to display vacations on gantt (collision handling)


Hi everyone,

I am currently using GPL version of Gantt.
Each task in my case displayed on the same line (render: split).

If a planning task belongs to me which starts 05.06.2019 duraton 5 days but the I am on vacation between 05.06.2019 and 10.06.2019.
There is a “collision” in this case I should have to display with different color in this case.

So, how can I display vacation dates on gantt to be able to handle collisions?
What would be the best solution?



Hi @cookiez!

If I understand you correctly you want just display collisions of the tasks and vacation dates on the timeline area.

There are various ways of how it might be implemented.

It can implement by using additional layers.
If you have vacation dates as a string type data modify it to the time object using method:

Use addTaskLayer() method to add custom elements for the task crossing the vacation dates:

Use valueOf() method from the public API to compare date values:

Here is a snippet how it can be implemented:

Alternatively you can do this using task_cell_class template.
Here is a related article:
Here is a related snippet:

Alternatively you can do this using task_class template.
Here is a related article:
Here is a related snippet:

You can also check the article and the sample about the working time:
Use setWorkTime() method to set the working time for the Gantt chart:
Use unsetWorkTime() method to unset vacation dates:

Does it resolve your issue? Please let me know if you need something different?