Open pmiklashevych opened 3 years ago
As a workaround users can update the project start date manually:
const calcStartDate = taskStore => {
let startDate = taskStore.getTotalTimeSpan().endDate;
if (startDate) {
taskStore.forEach(task => {
if (task.startDate.getTime() <= startDate.getTime()) {
startDate = task.startDate;
}
});
}
return startDate;
};
gantt.project.on({
dataReady : () => {
const startDate = calcStartDate(gantt.taskStore);
if (startDate && (startDate.getTime() !== gantt.project.startDate?.getTime())) {
console.log('Project start date is updated');
gantt.project.startDate = startDate;
}
}
});
Requested here: https://www.bryntum.com/forum/viewtopic.php?p=81782#p81782 https://www.bryntum.com/forum/viewtopic.php?p=81852#p81852
Testcase: Gantt/examples/_datasets/launch-saas.json
Run in console:
Expect it to be Mon Feb 04 2019 00:00:00 GMT+0300 (GMT+03:00) as the earliest start date among the tasks
NOT A BUG, since project start date is required to be passed to perform calculations. We take it as the earliest SPECIFIED date in the data. Not calculated date. And then we never update the project start date automatically.