How to make Gantt consider single day full-day tasks as 1 day duration using auto scheduling?


#1

Example:
Task 13.12.2021 - 13.12.2021 Gannt considers as 0 days
And it’s logical because time is 13.12.2021 00:00:00 - 13.12.2021 00:00:00

But we have to make Gantt consider it as 1 day.
So we are doing normalization with callbacks and making end_date the end of day
13.12.2021 00:00:00 - 13.12.2021 23:59:59

And it worked okay until we started using auto-schedule.
When we have link
Task 1: 13.12.2021 00:00:00 - 13.12.2021 23:59:59 -> Task 2: 14.12.2021 00:00:00 - 14.12.2021 23:59:59
Auto-scheduling thinks that it’s not optimal and makes
Task 2: 13.12.2021 23:59:59 - 14.12.2021 23:59:58
And that’s not what we need.

What would you recommend in this situation?


#2

Hello Oleg,
Gantt uses the non-inclusive duration. There is no way to change how Gantt works, but you can change what is displayed to the users by using the templates:
https://docs.dhtmlx.com/gantt/desktop__loading.html#loadingtaskdates
https://docs.dhtmlx.com/gantt/api__gantt_task_end_date_template.html
Here is an example of how it works:
http://snippet.dhtmlx.com/5/2fc90812a

Also, you can set the duration_unit to ‘hour’ and enable the work_time parameter:
https://docs.dhtmlx.com/gantt/api__gantt_duration_unit_config.html
https://docs.dhtmlx.com/gantt/api__gantt_work_time_config.html
Gantt will show the same dates in the grid because the hours will be different.
To show the duration in days and even in fractional values, you can use the formatters:
https://docs.dhtmlx.com/gantt/desktop__formatters_ext.html#durationformatter
Here is the snippet that demonstrates how it works:
http://snippet.dhtmlx.com/5/1aaa75fe9