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

Divide day block/cell to more blocks/cells

Asked by Anonymous
7 years ago.

Is it possible to divide block (cell) in hotel scheduler?
Small blocks should represent time period in day.
So if I divide it to 6 smaller block, each block is going to represent 4hours.
Thank you

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

It's possible to set custom cell size using the following settings:

dp.scale = "CellDuration";
dp.cellDuration = 240;   // 240 minutes = 4 hours

See also:
https://doc.daypilot.org/scheduler/time-cell-duration/

Just note that the hotel room booking tutorial (https://code.daypilot.org/27453/html5-hotel-room-booking-javascript-php) uses dp.scale = "Manual" and the cells are generated manually in loadTimeline() function. See also the "Check-In and Check-Out Time" of the tutorial.

Comment posted by Anonymous
7 years ago.

Thanks a lot! I change it to 360 // 6 hours
Then change .addHours to 6.
dp.timeline = [];
var start = date.getDatePart().addHours(6);
It is working, but it seems its loading calendar really slowly

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

What DayPilot version do you use?

Since 8.1 SP8 it should be able to handle a very long timeline without bigger performance problems:
http://javascript.daypilot.org/daypilot-pro-for-javascript-8-1-sp8/

The rest of the Scheduler shouldn't be affected much because by default it uses progressive rendering for cells and events (so it doesn't depend on the absolute grid size).

However, if you see a performance drop you may need to use a shorter timeline (e.g. 1 week instead of 1 month).

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