Hi,
I would do the following:
1. First setup you're working hours:
dp.businessBeginsHour = 7;
dp.businessEndsHour = 18;
2. Then I'll handle the onEventMove as well as the onEventResize event:
https://doc.daypilot.org/calendar/event-moving/ &
https://doc.daypilot.org/calendar/event-resizing/ - which will allow me to force the user to work in the ranges specified in step 1:
// the onEventResize event handler would work in the same way....
dp.onEventMove = function (args) {
if (someConditionIsTrue) {
args.preventDefault();
dp.message("Not Allowed");
}
};