DayPilot Knowledge Base

AJAX Calendar/Scheduling Controls
DayPilot Pro (AJAX Calendar Control)
» DayPilot AJAX Calendar
DayPilot Pro (AJAX Monthly Calendar Control)
» DayPilot AJAX Monthly Calendar
DayPilot Pro (AJAX Scheduler Control)
» DayPilot AJAX Scheduler
DayPilot » Knowledge Base » How to customize 'Week N' string in the Scheduler header

How to customize 'Week N' string in the Scheduler header

Last revision: Aug 31, 2010

The CellGroupBy = GroupByEnum.Week mode shows time columns grouped  by weeks. The first header column show the week number: 

scheduler-week-number.png

You can customize this text using BeforeTimeHeaderRender event:

protected void DayPilotScheduler1_BeforeTimeHeaderRender(object sender, DayPilot.Web.Ui.Events.BeforeTimeHeaderRenderEventArgs e)
{
  if (e.IsColGroup)
  {
    e.InnerHTML = String.Format("W {0}", Week.WeekNrISO8601(e.Start));
  }
}

The Week.WeekNrISO8601() helper method calculates a week number from a given date. The ISO 8601 week numbering system assumes that weeks starts on Monday.

You can set the first day of week using WeekStarts property (specify the day of week or "Auto" for automatic detection using the current culture).


Related

What is the duration of one week in minutes?
How to show business hours on weekends in Scheduler
How To Set Up Overnight Shift Scheduling with DayPilot Calendar
How to show one month per cell in Scheduler (CellDuration = Month)