Hello
There is no a specific api for this purpose but you can structure your tasks to include baseStart, start, baseEnd, end, and a status flag to indicate if the task is delayed. Here is an example of how you can define a task object:
const tasks = [
{
id: 1,
start: new Date(2024, 3, 2),
end: new Date(2024, 3, 17),
base_start: new Date(2024, 3, 2),
base_end: new Date(2024, 3, 13),
text: "Project planning",
progress: 30,
parent: 0,
type: "summary",
open: true,
details: "Outline the project's scope and resources.",
},
]
Then you can create a function to determine if a task is delayed based on the start and end date comparisons:
const isDelayed = (task) => {
return task.end > task.base_end; // You might want to adjust this logic
};
Please check the example: https://stackblitz.com/edit/sveltejs-kit-template-default-yu3mko5z?file=src%2Froutes%2FMyGantt.svelte