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

Using cellDuration with business hours

Asked by Alex
5 years ago.

Hi,

we're currently evaluating Daypilot JavaScript (react) Scheduler for use in our software product. I'm currently testing, if all the features and views we know from our current version (using another scheduler library) can be implemented with Daypilot Scheduler.
One thing I stumbled upon, was the use of cellDuration in combination with businessBeginsHour.

Below is my configuration:
{
"businessBeginsHour": 7,
"businessEndsHour": 17,
"businessWeekends": false,
"durationBarVisible": false,
"events": [],
"headerHeight": 20,
"heightSpec": "Parent100Pct",
"resources": [],
"showNonBusiness": false,
"startDate": "2019-07-31T14:49:51.004Z",
"cellDuration": 240,
"cellWidthMin": 35,
"cellWidthSpec": "Auto",
"days": 35,
"scale": "CellDuration",
"timeHeaders": [
{ "groupBy": "Week" },
{ "groupBy": "Day" },
{ "groupBy": "Cell" }
]
}

What I wanted to achieve in this setting is, that for each day the cells are rendered in 6 hours steps, starting from the configured businessBeginsHour. So here I'd expect a step a 7:00 and one at 13:00. Instead the scheduler always seems to start at the next hour, that is divisible by 6. So in this case it starts at 12:00 and shows only one step, since it spans to 18:00 (see attached screenshot). The effect is, that some of the events aren't visible, since they are before 12:00.

Am I doing something wrong? Is this intended or would it be a bug?

Thanks in advance,

Alex

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

The cells defined using cellDuration (or other scale types as well) will always start at 00:00 and the start won't be affected by the businessBeginsHour property. In fact, businessBeginsHour works best with cell size smaller than one hour.

In your case, it would be necessary to switch to scale="Manual" mode which lets you generate your own timeline. Please see also:

https://doc.daypilot.org/scheduler/timeline/

It's also possible to modify the start/end of the predefined time cells using onIncludeTimeCell event handler:
https://api.daypilot.org/daypilot-scheduler-onincludetimecell/

Comment posted by Alex
5 years ago.

Thanks for the answer. Using manual scale and calculatiing the timeline myself works great.

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