Scheduler: Hiding Non-Business Hours

scheduler-hide-non-business-noborder600x302.png

You can turn this feature on just by setting:

  • ShowNonBusiness="false"

This setup will hide:

  • Weekends (Saturday and Sunday)
  • Hours before BusinessBeginsHour (default value is 9) and after BusinessEndsHour (default 18)

DayPilot Scheduler: Showing Workdays Only

scheduler-hide-non-business-weekend671x353.png

DayPilot Scheduler: Showing 9AM - 6PM (+Lunch Break 1PM - 2PM)

scheduler-hide-non-business-lunch618x352.png

You can hide columns using BeforeTimeHeaderRender event handler:

protected void DayPilotScheduler1_BeforeTimeHeaderRender(object sender,
   DayPilot.Web.Ui.Events.BeforeTimeHeaderRenderEventArgs e)
{
  // lunch break from 1PM to 2 PM
  if (!e.IsColGroup && e.Start.Hour == 13)
  {
      e.Visible = false;
  }
}

DayPilot Scheduler: Showing 9AM - 6PM (Lunch Break Highlighted)

scheduler-hide-non-business-color687x352.png

Column hiding can be combined with cell highlighting. The lunch break can be highlighted instead using BeforeCellRender event handler:

    protected void DayPilotScheduler1_BeforeCellRender(object sender, DayPilot.Web.Ui.Events.BeforeCellRenderEventArgs e)
{
    if (e.Start.Hour == 13)
    {
        e.IsBusiness = false;
    }
}

Note that setting IsBusiness property in BeforeCellRender will not hide the column, but rather use the color specified for non-business hours (NonBusinessBackColor) for that cell.

DayPilot for ASP.NET WebForms, DayPilot for ASP.NET MVC, DayPilot for Java