calendar
PRO
The functionality is available in PRO Edition only
Description
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
<script setup>
import { Gantt } from "@svar-ui/vue-gantt";
import { Calendar } from "@svar-ui/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>
<template>
<Gantt
:tasks="tasks"
:links="links"
:calendar="calendar"
/>
</template>
Related articles: