Skip to main content

calendar

The functionality is available in PRO Edition onlyPRO

Description

Sets a global working-time calendar for the Gantt chart

The 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

<script>
import { Gantt } from "@svar/svelte-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,
},
});
</script>

<Gantt
{tasks}
{links}
{calendar}
/>

Related articles: