Header date/time format

DayPilot Scheduler uses predefined DateTime formats based on the time unit used in the header:

First header row (groups)

GroupBy="Hour"

Hour in format determined by TimeFormat property (12 or 24 hour clock).

Example: "12 AM"

GroupBy="Day"

Date formatted using DateTime.ToLongDateString().

Example: "Sunday, January 25, 2009"

GroupBy="Week" 

For cells wider than 115 pixels:

  • "Week XX (YYYY)" where XX is the week number according to ISO 8601 and YYYY is year.

For cells shorter than 115 pixels:

  • Week number according to ISO 8601

GroupBy="Month"

Month formatted using DateTime.ToString("MMMM yyyy").

Example: "January 2009"

GroupBy="None"

Empty string.

Second header row (columns)

CellDuration < 60

Minutes formatted using ToString("00").

Example: "05"

CellDuration < 1440

Hour in format determined by TimeFormat property (12 or 24 hour clock).

Example: "12 AM"

CellDuration >= 1440

Day number (in month).

Example: "31"

Custom format

The default values can be overriden using BeforeTimeHeaderRender event handler.

Example:

    protected void DayPilotScheduler1_BeforeTimeHeaderRender(object sender, DayPilot.Web.Ui.Events.BeforeTimeHeaderRenderEventArgs e)
    {
        if (e.IsColGroup)
        {
            e.InnerHTML = e.Start.ToShortDateString();  // sets the group header
        }
        else
        {
            e.InnerHTML = e.Start.Hour.ToString(); // sets the column header
        }
    }

 

 

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