Late Start + Late Finish Calculation


I have been trying to generate the common terms mentioned in the subject from the data which I have,

  1. Start Date
  2. End Date
  3. Duration
  4. Free Slack (DHTMLX Gantt Supports using gantt.getFreeSlack(task))

And my calculation follows;

Late Start
Late Start (Date) = start_date + taskFreeSlack

Late Finish
Late Finish (Date) = Late Start + duration

When I compare with Primavera/MS Project even though there are no slack the task has got different Late start and late finish (Supposed to be same as Start date and End Date.


MS Project

Am I doing correct here? or do you have any other methods to calculate.

Do we have any in-built functionality to straight away generate these value.


Gantt calculates slack values depending on other tasks. Free slack – a period of time that can be used to increase the duration of a task or move it on the timeline without affecting the next task it is connected with. Total slack – a period of time that can be used to increase the duration of a task or move it on the timeline without affecting the time of ending of the whole project: ;
The task progress and other task properties are not included in the Slack calculations.
There are no built-in methods to calculate Late Start and Late Finish properties in Gantt. If you calculate the Late Start and Late Finish properties of the task with no slack in Gantt, so it will be the same dates as start and end dates.
Primavera/MS Project use another slack calculations formulas. There are articles that describe how MS Project calculates Late Start and Late Finish fields: ; ;

Thanks for the information @ArtyomBorisevich,

DHTMLX Gantt total slack calculated duration does match with Primavera P6/Microsoft Project, though DHTMLX Gantt may be using different method for calculation the output needs to be similar.

The free slack matches with Primavera P6/Microsoft Project, but not total slack.

  template: function (task) {
    if (task.type !== gantt.config.types.placeholder) {
      return gantt.getTotalSlack(task);
    return null;

Please look at the screenshots


Microsoft Project


Gantt uses a different slack logic which is slightly different from Primavera/MS Project (the task progress and other task properties are not included in the Slack calculations).
Could you please send your MS Project file where the issue is reproduced?
Could you reproduce your Gantt’s configuration to the following snippet: ;
Then, click on the Save button and send me the link.


While editing I am getting errors, in the plugins section

VM1741:302 Uncaught TypeError: gantt.getTotalSlack is not a function

This is what so far I have edited .

and FYI I am using dhtmlxGantt v.7.0.13 Professional.

Please find the MPP file below for your reference.

Thank you.testing2.mpp (718.5 KB)


Thanks for the attached file and snippet, but the snippet is not complete.
Therefore, it was not possible to reproduce the problem locally in the snippet.
Also, you can’t configure how slack is calculated in Gantt, so if you need the calculation logic to be like in MS Project, then you need to make a custom solution.

Hello @ArtyomBorisevich,
I do not calculate Slack (Both Free Slack and Total Slack) I am utilizing the functionality provided by DHTMLX.

Free Slack : gantt.getFreeSlack(taskObject) and I am getting correct value (Comparing the Free Slack given by MS Project).

Total Slack : gantt.getTotalSlack(taskObject) which gives me a ‘0’ where it supposed to give me a different number.

Here is the fixed snippet

Good day @ArtyomBorisevich,

Any update on the above?


Thanks for the attached snippet.
In your snippet, you specified a version of Gantt 7.0, where Gantt calculates Slack not always correctly: ;
Please check the following example with the latest version of Gantt: ;

Gantt uses the following calculation logic:
Free Slack counted as distance between tasks, and Total Slack is calculated as the sum of these distances. ;
The task progress and other task properties from MS Project (Early Start, Early Finish, Late Start, and Late Finish fields:
are not included in the Slack calculations in Gantt.

Hello @ArtyomBorisevich,
What I am understanding from the above explanation is that the version ie; dhtmlxGantt v.7.0.13 Professional which my organization has purchased has bug in slack calculation?

If got bugs how do I rectify it?
Should I purchase new version? or you will provide me with a patch to fix it?

Please let me know the available option.


Hello @ArtyomBorisevich,

Any solutions on the above matter?

Please contact the support team to discuss that question via and provide us your license number.
Requests that are sent to technical support have a higher priority, so they are answered faster.

Thank you @ArtyomBorisevich