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

Don't plan outside business hours

Asked by Maarten
3 years ago.

Hi all

I can't seem to find an answer to this. I only get to the point where you can hide non-business hours, but that's not what I am after.

We have a situation in our company where normal business hours are from 8-17. Sometimes however, we have days where overtime is planned and business hours continue to 21. So hiding non business hours only is not an option.

In the application we use Daypilot Calendar to plan machine times. We use an external source for dragging in productions for machines. These productions have a pre-calculated length. So if you drag in a production of 8 hours, Daypilot creates an item of 8 hours long.

There it gets problematic. If you plan an 8 hour long productiontime at 15:00 it needs to have 2 hours on that day and continue for 6 hours (from 8 till 16) the next day. But Daypilot just plans in this production from 15:00 till 24:00 the first day and the next day from 24:00 till 01:00.

The question then is: is Daypilot able to automatically avoid any planning to be done outside business hours? Or do you have to write code yourself to calculate how much time you can plan on each day and add 1 or more events accordingly?

Thanks a bunch.

Best regards,
Maarten
The Netherlands

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

With the Scheduler component, it is possible. Please take a look at the following tutorial:
https://code.daypilot.org/57279/javascript-scheduler-skip-non-business-cells-during-drag-an

Please let me know if this is not what you are looking for.

Comment posted by Maarten
3 years ago.

Thanks for your swift response!

The Scheduler is an outstanding component. But there's a disadvantage using it. When planning productions for machines, you need to know the full workload of a week, or sometimes even a month. With a horizontal scheduler you actually can only view 1 day. Otherwise the scrollbar will get way to long and you won't have the overview because you have to scroll sideways too much.

Productions also don't always take days. They are calculated in hours. So we need to be able to plan multiple productions on 1 day on hour level.

So I guess I'd have to calculate it with own code.

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

Unfortunately, in the Calendar it's indeed necessary to use your own logic.

From our point of view, the Scheduler offers much greater flexibility so when adding features we focus on the Scheduler.

I'm not sure if you have seen it but you can change the scale to hours (or other units) as well:
https://javascript.daypilot.org/demo/scheduler/scalehours.html

It can also display a single-resource week view like the Calendar (but with switched axes):
https://javascript.daypilot.org/demo/scheduler/timesheet.html

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