Hi, I'm trying to include holidays in my Gantt chart so the project timeline would reflects the impact of holidays on project schedule.
Below is how I've done so far. However, the timeline is still running on holidays. Please help me.
let holidays = [
new Date (2023, 4, 1),
new Date (2023, 4, 4),
];
let taskData = [
{
id: 1,
title: "Task 1",
orderId: 0,
start: new Date("2023-04-30 08:00:00"),
duration: 24,
percentComplete: 0.45,
isExpanded: true,
},
},
{
id: 2,
title: "Task 2",
orderId: 2,
start: new Date("2023-05-02 08:00:00"), duration: 10,
percentComplete: 1,
isExpanded: true,
},
{
id: 3,
title: "Task 3",
orderId: 3,
start: new Date("2023-05-02 17:30:00 "), duration: 10,
percentComplete: 0.77,
isExpanded: true,
},
},
];
let dataWithEndDate = taskData.map((task) => ({
...task,
end: new Date (task.start.getTime() + task.duration * 60 * 60 * 1000),
}));
render() {
return (
<div>
<Gantt
taskData={dataWithEndDate}
taskData={dataWithEndDate}
columns={columns}
holidays={holidays}
>
</Gantt>
</div>
);
}