Well the duration is (at most) 23:59h which is not a full day. As the duration is given as an integer that is the expected behaviour. If the task is only scheduled to last from 15:00 to 16:00 then showing one day would be wrong wouldn’t it?
However where do you want to display the duration? Can’t you simple fake the result you want it to have? For example in the gantt bars itself you could have something like:
gantt.templates.task_text = (start, end, task) => {
// if the task starts and ends on the same day, it is assumed to last the whole day
if(gantt.date.date_part(start) === gantt.date.date_part(end)) {
return 1;
}
return gantt.calculateDuration(task);
}
---------------------------------------------------------------------------------------- So is that possible ??? ----------------------------------------------------------------------------------------- Need Answer As Soon As Possible !!!
Hello,
If you don’t specify the time for the date Gantt considers it as 00:00:00. So this is how it looks in your example:
start date ----> 12-12-18 00:00:00
end date ----> 12-12-18 00:00:00
Here is another example:
start date ----> 12-12-18 09:00:00
end date ----> 12-12-18 12:00:00
If your duration unit is hour, the duration parameter will show the number of hours. And it will be 3 hours.
But if your duration unit is day, Gantt will round the duration and it will be 0 days.
There is no built-in solution to change the logic that is used to calculate the duration. And there are various ways how to work around it.
I think the easiest way would be to subtract 1 minute before updating a task or opening the lightbox. Here is an example: http://snippet.dhtmlx.com/a73af08c3