Duration Not Include Weekend

Hello Tim DHTMLX,
Sorry I need help, how to calculate the duration just to allow weekdays?

thank you.

There is a work_time config which enables calculating the duration of tasks in working time instead of calendar time. It means that Gantt doesn’t take into account the weekends when calculates the duration of the tasks when the work_time enabled. By default, this config is disabled:
work_time Gantt Docs ;
Please check the examples:
Working days as duration ;
DHTMLX Snippet Tool ;
If it doesn’t help you, please, add your configuration in the snippet above and make sure that the issue is reproduced there. Then, click on the Save button and send me the link. Or send me a ready demo with all the necessary JavaScript and CSS files so that I can reproduce the issue locally.

okay, thank you sir for the help me.
temporary my backend to calculate duration. but I have an issue again the gan UI does not reset/reload after adding a new task.

sorry, my English is not good.

use gantt.clearAll() for reset cacke

thank you…

still an issue I can’t redo/undo the task :sweat_smile:
because :

  • first, when creating a new task I do not send the id default from generating Gantt to the database. when I undo the call method delete task brings the default id Gantt and is not found when the call method deletes my API so my application error.
  • how to solution redo/undo for me I am using call API from the backend.
  • is the ID from Gantt unix or not?

Hello Septe,
It depends on how it is implemented in your case.
By default, when you create a new task, Gantt adds the timestamp to the task ID:

If you use the Data Processor, Gantt sends the task to the server, but the ID is not sent. Then the server should return the ID for the task and Gantt will update the task ID on the client-side:

When I use that approach, I cannot reproduce the issue:

Here is the demo:

Thank you, sir.
thank you for the solution.
I will try again. :pray: