Problem for calculateDuration()


#1

under is my gantt config :
gantt.config.work_time= true;
gantt.config.skip_off_time = true;
gantt.setWorkTime({hours:[“08:00-20:00”]})
and I have a task ,it’s start_date is ‘15-06-2020 08:00:00’
the calculateDuration(task) return 0

if I setWorkTime({hours:[“07:59-20:00”]}) the calculate result is 4 but the gantt scale unit include 6:00-7:00


#2

Hello Shifty,
I added the code you sent to our snippet but couldn’t reproduce the issue:
http://snippet.dhtmlx.com/5/b35964710
It would be nice of you to clarify this point:

and I have a task, it’s start_date is ‘15-06-2020 08:00:00’
the calculateDuration(task) return 0

can you please tell me what is the end_date value of this task? Or you can reproduce your code and data in the snippet above, “share” and send me a link. Otherwise, I can’t reproduce the issue, we need both start_date and end_date in order to calculate the duration between them.