# gantt-holidays

> Gantt chart displaying configured holidays alongside tasks and working time settings.

**Framework:** aspnet-core  **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/aspnet-core/gantt-holidays.json
```

**Install Package(s)**

```bash
dotnet add package Syncfusion.AspNetCore.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.cshtml

```cshtml
@page
@namespace aspnet_core.Gantt.Holidays
@model EJ2CoreSampleBrowser.Gantt.Holidays.HolidaysModel
@using Syncfusion.EJ2

    <div class="control-section">
        <div class="row">
            <div class="col-md-12">
                <ejs-gantt id='Holidays' dataSource="@Model.DataSource" height="420px" rowHeight="46"
                    taskbarHeight="25" treeColumnIndex="1" highlightWeekends="false"
                    renderBaseline="false" includeWeekend="false"
                    projectStartDate="2025-04-01" projectEndDate="2025-08-31">
                    <e-gantt-taskfields id="TaskId" name="TaskName" startDate="StartDate" endDate="EndDate" duration="Duration" progress="Progress" parentID="ParentID"></e-gantt-taskfields>
                    <e-gantt-holidays>
                        @foreach (var h in Model.Holidays)
                        {
                            <e-gantt-holiday from="@h.From" to="@h.To" label="@h.Label"></e-gantt-holiday>
                        }
                    </e-gantt-holidays>
                    <e-gantt-columns>
                        <e-gantt-column field="TaskId" width="80"></e-gantt-column>
                        <e-gantt-column field="TaskName" headerText="Task" width="250" clipMode="EllipsisWithTooltip"></e-gantt-column>
                        <e-gantt-column field="StartDate"></e-gantt-column>
                        <e-gantt-column field="Duration"></e-gantt-column>
                        <e-gantt-column field="Progress"></e-gantt-column>
                    </e-gantt-columns>
                    <e-gantt-splittersettings columnIndex="2"></e-gantt-splittersettings>
                    <e-gantt-labelSettings leftLabel="TaskName"></e-gantt-labelSettings>
                </ejs-gantt>
            </div>
        </div>
    </div>

```

### src/components/gantt-holidays/gantt.cshtml.cs

```cs
using System;
using System.Collections.Generic;
using Microsoft.AspNetCore.Mvc.RazorPages;

namespace EJ2CoreSampleBrowser.Gantt.Holidays
{
    public class HolidaysModel : PageModel
    {
        public List<HolidayRange> Holidays { get; set; }
        public List<HolidayTask> DataSource { get; set; }

        public void OnGet()
        {
            DataSource = new List<HolidayTask>
            {
                new HolidayTask { TaskId = 1, TaskName = "Onboarding sprint", StartDate = new DateTime(2025, 4, 7),  EndDate = new DateTime(2025, 4, 18), Duration = 10, Progress = 100 },
                new HolidayTask { TaskId = 2, TaskName = "Feature build",     StartDate = new DateTime(2025, 4, 21), EndDate = new DateTime(2025, 5, 16), Duration = 20, Progress = 60 },
                new HolidayTask { TaskId = 3, TaskName = "Stabilization",    StartDate = new DateTime(2025, 5, 19), EndDate = new DateTime(2025, 6, 6),  Duration = 15, Progress = 10 },
            };
            Holidays = new List<HolidayRange>
            {
                new HolidayRange { From = new DateTime(2025, 5, 1),  To = new DateTime(2025, 5, 1),  Label = "Labour Day" },
                new HolidayRange { From = new DateTime(2025, 5, 26), To = new DateTime(2025, 5, 30), Label = "Team Offsite" },
            };
        }
    }

    public class HolidayRange
    {
        public DateTime From { get; set; }
        public DateTime To { get; set; }
        public string Label { get; set; }
    }

    public class HolidayTask
    {
        public int TaskId { get; set; }
        public string TaskName { get; set; }
        public DateTime StartDate { get; set; }
        public DateTime EndDate { get; set; }
        public int Duration { get; set; }
        public int Progress { get; set; }
    }
}

```
