# Calendars and Duration
URL: https://pro.rv-grid.com/guides/gantt/scheduling/calendars/
Source: src/content/docs/guides/gantt/scheduling/calendars.mdx
Description: Define working days, holidays, and how they affect task duration calculations.
By default, `duration` is measured in calendar days. Enable working-day duration when weekends and holidays should be skipped:

```typescript
grid.gantt = {
  scheduling: {
    excludeHolidaysFromDuration: true,
  },
};
```

## Defining Calendars

Calendars use ISO weekday numbers where Monday is `1` and Sunday is `7`:

```typescript
grid.ganttCalendars = [{
  id: 'cal-standard',
  name: 'Standard',
  timeZone: 'UTC',
  workingDays: [1, 2, 3, 4, 5],
  holidays: ['2026-05-25'],
  hoursPerDay: 8,
}];
```

Each task references a calendar through `calendarId`. Resource capacity checks use the resource calendar when a resource is assigned.

## Working-Day Lag

Use working-day lag when dependency offsets should skip weekends and holidays:

```typescript
grid.gantt = {
  scheduling: {
    lagCalendar: 'working-days',
  },
};
```

**Example**: A one-day lag after a Friday skips the weekend and a Monday holiday, landing on Tuesday.

  Each task references a calendar via its `calendarId` field. Tasks on different calendars respect their own working days and holidays independently.
