Skip to main content

Calendar

The functionality is available in PRO Edition onlyPRO

Description

Calendar module

The Calendar module defines the working-time model used by the Gantt chart. It controls which days are working, how many hours each weekday contains, and how task dates are calculated during scheduling, dragging, resizing, or linking. Attaching a calendar allows you to fully customize how the timeline behaves.

You can import the component from @svar-ui/svelte-gantt .

Instructions about adding and customizing the Calendar see here: Adding a calendar.

Calendar methods

OperationMethodPurpose
Set single day hourssetDayHours()Override hours for specific date
Set range hourssetRangeHours()Override hours for date range
Check if working dayisWorkingDay()Test if date has positive working hours
Get hours for dategetWorkingHours(date)Query hours on single date
Sum hours in rangegetWorkingHours(start, end)Calculate total hours between dates
Count working daysgetWorkingDays()Count days with non-zero hours
Find next working daygetNextWorkingDay()Locate next date with hours > 0
Find previous working daygetPreviousWorkingDay()Locate previous date with hours > 0
Add working daysaddWorkingDays()Move forward/backward by N working days
Add custom ruleaddRule()Register dynamic hour calculation function
Create derived calendarclone()Duplicate with inheritance transformation

Detailed description see here: Calendar methods.

Calendar properties

Properties description see here: Calendar properties.


Related articles: