Could you please shed some light on the difference between these two templates:
gantt.templates.date_grid
and
gantt.templates.grid_date_format
Thanks in advance.
Could you please shed some light on the difference between these two templates:
gantt.templates.date_grid
and
gantt.templates.grid_date_format
Thanks in advance.
Hello Nikolai,
gantt.templates.grid_date_format internally, but also adds additional logic (like handling unscheduled tasks). In the default implementation, it checks for unscheduled tasks and handles them differently before calling grid_date_format.So, you can override grid_date_format if you just need to change the date formatting for all date columns. Or you can override the date_grid template if you need task-specific logic when displaying dates in grid columns and you need to have access to the full task object.
In this example, the grid_date_format template is used to make end_date inclusive when displaying it in the grid column.
And in this snippet, just for example, we use the date_grid template to to access the full task object and display dates in the necessary format based on some properties.
Best regards,
Valeria Ivashkevich
DHTMLX Support Engineer