Open bbkfhq opened 2 days ago
Hello,
Yes the methods don't appear in the Gantt interface file since they are private. We'll consider making the methods public.
Thank you for the report.
P.S. Worth mentioning that those methods could be not correct for the Gantt if using day
unit or a greater one. The reason is units conversion - the mentioned methods use DateHelper
to convert units while the Gantt overrides duration units on the project level:
https://bryntum.com/products/gantt/docs/api/Gantt/model/ProjectModel#field-hoursPerDay
https://bryntum.com/products/gantt/docs/api/Gantt/model/ProjectModel#field-daysPerWeek
https://bryntum.com/products/gantt/docs/api/Gantt/model/ProjectModel#field-daysPerMonth
But as long as effort is expressed in hours that should not hurt.
Core/data/Duration.js
has two methods calledadd
anddiff
for adding and subtracting duration objects to and from each other.However, these methods are not defined on the interface for
Duration
in@bryntum/gantt/gantt.d.ts
.I'm guessing it's because
add
anddiff
are private API?My use case is: I have
effort
andactualEffort
, and I want to calculateremainingEffort = effort - actualEffort
At the moment I'm relying on a type-cast like this:
Version:
@bryntum/gantt
v6.1.2