# gantt-holidays

> Gantt chart sample highlighting holidays, non-working days, and resource scheduling.

**Framework:** javascript  **Component:** Gantt  **Variant:** holidays

## Get this item

**If you are an agent, fetch the JSON.** Source is inlined, so one request is enough and no tooling is required:

```
GET https://ai.syncfusion.com/r/javascript/gantt-holidays.json
```

**Install Package(s)**

```bash
npm install @syncfusion/ej2-gantt
```

**Notes**

- Syncfusion release: 2026 Volume 3 (v35.1.37)
- The Syncfusion package is licensed. The composition in this file is source you own and edit. See https://ai.syncfusion.com/licensing.md

## Source files

### src/components/gantt-holidays/gantt.html

```html
<div class="control-section">
    <div class="content-wrapper">
        <div id="container">
        </div>
    </div>
</div>

```

### src/components/gantt-holidays/gantt.ts

```typescript
import { Gantt, Selection, DayMarkers } from '@syncfusion/ej2-gantt';
import { projectNewData } from '../datasource/gantt-data';
/**
 * Holidays Gantt sample
 */

Gantt.Inject(Selection, DayMarkers);

export function initHolidaysGantt(): void {
    let gantt: Gantt = new Gantt(
        {
            dataSource: projectNewData,
            height: '650px',
            rowHeight: 46,
            taskbarHeight: 25,
            highlightWeekends: true,
            taskFields: {
                id: 'TaskID',
                name: 'TaskName',
                startDate: 'StartDate',
                endDate: 'EndDate',
                duration: 'Duration',
                progress: 'Progress',
                dependency: 'Predecessor',
                parentID: 'ParentId'
            },
            treeColumnIndex: 1,
            columns: [
                { field: 'TaskID', visible: false , width: 80 },
                { field: 'TaskName', headerText: 'Name', width: 280 },
                { field: 'StartDate' },
                { field: 'EndDate' },
                { field: 'Duration' },
                { field: 'Predecessor' },
                { field: 'Progress' }
            ],
            labelSettings: {
                rightLabel: 'TaskName'
            },
            splitterSettings: {
                columnIndex: 1
            },
            holidays: [
                {
                    from: new Date('03/28/2025'),
                    to: new Date('03/28/2025'),
                    label: 'Good Friday'
                },
                {
                    from: new Date('03/30/2025'),
                    to: new Date('03/30/2025'),
                    label: 'Easter Sunday'
                }, 
                {
                    from: new Date('05/26/2025'),
                    to: new Date('05/26/2025'),
                    label: 'Memorial Day'
                }, 
                {
                    from: new Date('07/04/2025'),
                    to: new Date('07/04/2025'),
                    label: 'Independence Day'
                }, 
            ],
            projectStartDate: new Date('03/25/2025'),
            projectEndDate: new Date('07/20/2025')
        });
    gantt.appendTo('#container');
}

```
