calendar
The functionality is available in PRO Edition only
PRODescription
Sets a global working-time calendar for the Gantt chartThe calendar defines working hours and non-working days that will be used by all tasks in the Gantt unless overridden locally.
Usage
calendar?: Calendar;
Parameters
calendar- a global Calendar instance applied to the entire Gantt
All tasks inherit its working-time rules (working days, working hours per day, custom rules, etc.). If not set, Gantt uses its internal default calendar (typically 8-hour weekdays, weekends off).
Example
import { Gantt } from "@svar/react-gantt";
import { Calendar } from "@svar/gantt-store";
import { getData } from "../data";
const { tasks, links } = getData();
const calendar = new Calendar({
weekHours: {
monday: 8,
tuesday: 8,
wednesday: 8,
thursday: 8,
friday: 8,
saturday: 0,
sunday: 0,
},
});
export default function App() {
return <Gantt tasks={tasks} links={links} calendar={calendar} />;
}
Related articles: