Calendar
Description
Calendar moduleThe 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
| Operation | Method | Purpose |
|---|---|---|
| Set single day hours | setDayHours() | Override hours for specific date |
| Set range hours | setRangeHours() | Override hours for date range |
| Check if working day | isWorkingDay() | Test if date has positive working hours |
| Get hours for date | getWorkingHours(date) | Query hours on single date |
| Sum hours in range | getWorkingHours(start, end) | Calculate total hours between dates |
| Count working days | getWorkingDays() | Count days with non-zero hours |
| Find next working day | getNextWorkingDay() | Locate next date with hours > 0 |
| Find previous working day | getPreviousWorkingDay() | Locate previous date with hours > 0 |
| Add working days | addWorkingDays() | Move forward/backward by N working days |
| Add custom rule | addRule() | Register dynamic hour calculation function |
| Create derived calendar | clone() | Duplicate with inheritance transformation |
Detailed description see here: Calendar methods.
Calendar properties
Properties description see here: Calendar properties.
Related articles: