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

Customise Cell Duration Label

Asked by Graham
7 years ago.

I have a scheduler with which I have customised the cell duration to be half days:

@Html.DayPilotScheduler("dps_links", new DayPilotSchedulerConfig{
....
CellDuration = 1440,

This now shows with the timescales of:

0 | 12 | 0 | 12 | 0 | 12

is there any way that I can change this so that is says:

Morning | Afternoon | Morning | Afternoon

Thanks

Comment posted by Graham
7 years ago.
Answer posted by Dan Letecky [DayPilot]
7 years ago.

You can customize the time headers using OnBeforeTimeHeaderRender:
http://doc.daypilot.org/scheduler/time-header-customization/

The sample code would look like this:

protected override void OnBeforeTimeHeaderRender(BeforeTimeHeaderRenderArgs e)
{
  if (e.Level == 1) {  // second time header row
    if (e.Start.Hour == 0) {
      e.InnerHtml = "Morning";
    }
    else {
      e.InnerHtml = "Afternoon";
    }
  }
}
Comment posted by Dan Letecky [DayPilot]
7 years ago.

Just one more note - you will probably want to use CellDuration = 720 (1440 would be one day).

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