Duration is off by 1 on gantt parse

When I calculate a task duration, on initial render the task is given a duration of -1 from the calculated duration.

So if a task has a duration of 3, it shows as a duration of 2.

If I update a tasks duration it shows correctly. How can I fix this?


Could you please reproduce the issue here? docs.dhtmlx.com/gantt/snippet/
It is not a typical problem, perhaps you have custom code which changed default behaviour. Demo should help us understand the cause of it.

And please specify the way you calculate task duration.

Thanks, I will do this soon.

I have set a demo up here.



In your case end_date is 2017-09-13. So it means that your event finishes October 13th at 00:00 and covers October 12th and don’t cover October 13th. Duration of the event is 2 days (11, 12 Oct).

hmm I guess I have to do with out the end_date field or create my own instead.