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

Display 15 30 45 minutes

Asked by Rakesh
12 years ago.

If I keep the cell duration as 5 minutes I see 12 slots between any 2 hours.How can I display 15, 30 & 45 mins between any 2 hours.
Thanks

Comment posted by Dan Letecky [DayPilot]
12 years ago.

In the Calendar, it's only possible to use CellDuration values that divide an hour without any remainder. I.e. setting CellDuration="45" wouldn't work.

In the Scheduler, it's possible to use any positive integer value as CellDuration.

It's also possible to hide individual columns in the Scheduler using BeforeTimeHeaderRender (set e.Visible = false) and ShowNonBusiness=false. See also:

http://www.daypilot.org/scheduler-hiding-non-business-hours.html

Comment posted by Rakesh
12 years ago.

No you did not get the question right. I don't want to set the cell duration to 45 minutes. I want to set the cell duration as 5 mins. So between any 2 hours I will see 12 lines each line indication 5 minutes. Is there a way to display labels for 15, 30 and 45 minutes between any 2 hours.
See below
8 am

15-

30-

45-

9 am

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

I see. You can do this using BeforeTimeHeaderRender event handler:

http://kb.daypilot.org/75335/how-to-show-precise-time-in-the-calendar-row-headers/

Comment posted by Rakesh
12 years ago.

Perfect thanks. Can this be a standard feature like the others?

Comment posted by Dan Letecky [DayPilot]
12 years ago.

I'm adding it to the wishlist.

Comment posted by Anonymous
11 years ago.

Has this "wish list" item been implemented in a better way or can you give me an example of how to do this using the DayPilotScheduler

Comment posted by Anonymous
11 years ago.

OK so I figured it out, but sure would be nice if there were an easier way.

protected override void OnBeforeTimeHeaderRender(BeforeTimeHeaderRenderArgs e)
{
if (e.IsColGroup == false)
{ // not the date header column - format the time header to show hrs & mins, not just mins
e.ToolTip = e.Start.ToShortTimeString();
// extract the <span> definition so we can replicate the same html for each timeslot
String html = e.InnerHtml;
int index = html.IndexOf(">");
e.InnerHtml = html.Substring(0, index + 1) + e.ToolTip + "</span>";
}
}

Comment posted by Dan Letecky [DayPilot]
11 years ago.

Just for reference, there are two new features related to displaying the time scale.

Calendar
You can adjust the duration of the time header cells using TimeHeaderCellDuration property. This used to be fixed to 60 minutes (one cell per hour in the time header)
This is supported since 7.1 release: http://www.daypilot.org/daypilot-pro-for-asp-net-webforms-7-1.html
See a demo here: http://www.daypilot.org/demo/Calendar/TimeHeaderCellDuration.aspx

Scheduler
You can add multiple levels to the time header using TimeHeaders property. There used to be only one "group" level available, with the scale determined by CellGroupBy property.
This is supported since 6.9 release: http://www.daypilot.org/daypilot-pro-for-asp-net-webforms-6-9.html
See a demo here: http://www.daypilot.org/demo/Scheduler/TimeHeaders.aspx

The customization of the cell content has to be done using On/BeforeTimeHeaderRender.

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