search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

highlight bank holidays in scheduler

Asked by Stuart
10 years ago.

Hi how can I highlight UK bank holidays along with week ends in the scheduler

Answer posted by Dan Letecky [DayPilot]
10 years ago.

1. First you need the holiday data.
2. Add a BeforeCellRender event handler. This event is called once for each time cell. You should check the cell date (e.Start, e.End) here and compare it with the holiday data.
3. Set e.IsBusiness or e.BackgroundColor as needed. In CssOnly mode, it's better to use e.CssClass instead.

Example:

    protected void DayPilotScheduler1_BeforeCellRender(object sender, DayPilot.Web.Ui.Events.BeforeCellRenderEventArgs e)
    {
        if (IsHoliday(e.Start))
        {
            e.CssClass = "holiday_cell";
        }
    }

This will mark all holiday cells with .holiday_cell class. You need to provide your own IsHoliday() method.

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.