If the task ends the day, how do I change the duration to 1


Now I need to add the duration to 0 plus 1, or add all the duration to 1.

Hello,
Do you want to make the duration inclusive?
Gantt stores the end_date in a non-inclusive format. Unfortunately, there is no way to change it. But you can change what is displayed in the grid and the lightbox by changing the end_date template.
That functionality was added in the 6.3.0 version:
https://docs.dhtmlx.com/gantt/api__gantt_task_end_date_template.html
https://docs.dhtmlx.com/gantt/desktop__loading.html#loadingtaskdates
Here is the snippet that demonstrates how it works:
http://snippet.dhtmlx.com/5ce879b8b

If the task schedule is set by start_date and end_date, can the duration of tasks with the same start date and end_date be 1?

Hello,
You can change what is displayed in Gantt, but there is no way to change how Gantt stores the data.
So, you can have the same date for the start_date and end_date parameters in the grid and the lightbox, and the duration will be 1 day:
https://snippet.dhtmlx.com/5ce879b8b

But you cannot have the same date in those values to have 1-day duration:

1 Like

Ok, got it. Thanks for your answer.