Skip to main content

Resource calendar

You can define working calendars for individual resources. To do so, create calendars by defining their configuration with the calendars property, then set calendar IDs to the needed resources via the calendar field in the resources array.

<script>
import { Gantt } from "@svar-ui/svelte-gantt";

const calendars = [
{
id: "standard",
name: "Standard",
weekHours: { monday: 8, tuesday: 8, wednesday: 8, thursday: 8, friday: 8 },
},
{
id: "part-time",
name: "Part-time",
weekHours: { monday: 4, tuesday: 4, wednesday: 4, thursday: 4, friday: 4 },
},
];

const resources = [
{ id: "r1", name: "Alice", calendar: "standard" },
{ id: "r2", name: "Bob", calendar: "part-time" },
];
</script>

<Gantt {calendars} {resources} {tasks} {links} />

When defined, resource calendars are used in load calculation in the ResourceLoad view, and resource-specific holidays are highlighted when Gantt is grouped by resource. Note that resource calendars do not affect task bar length, which depends only on the global and task calendar.

More about calendars, see: Calendar