The task duration can be shorter than the project.
If the user wants to extend the task, it should change the parent's duration too. But shortening the task duration should not affect the parent's duration.
Need similar behavior between subtask and task.
That can be done by overriding end date calculation code like this:
export class Task extends TaskModel {
...
// Overwrite sndDate calculation
* calculateEndDatePure() {
const manuallyScheduled = yield this.$.manuallyScheduled;
const hasSubEvents = yield * this.hasSubEvents();
// if that's a parent task and it's not manually scheduled
if (!manuallyScheduled && hasSubEvents) {
// get max children end date
const childrenDate = yield * this.calculateMaxChildrenEndDate();
// get this task current end date
const previousValue = yield ProposedOrPrevious;
// use max children end date if it's > current value
return childrenDate > previousValue ? childrenDate : previousValue;
}
else {
return yield * super.calculateEndDatePure();
}
}
}
Thanks.
I don't need it completely independent from parent tasks. Need to change the duration only if the task exceeds its parent. Can we do it using ProjectModel Class. I am using Gantt in functional components with typescript.