How can I restrict the Scheduler to only allow the dates I specify?
Support Forum
Which dates are we talking about? Do you mean to limit the timeline view? If yes you can use min/max dates on it.
https://bryntum.com/products/scheduler/docs/api/Scheduler/view/Scheduler#config-maxDate
https://bryntum.com/products/scheduler/docs/api/Scheduler/view/Scheduler#config-minDate
Are we talking about not showing a specific day? If yes we can filter out the days while generating ticks. Please check this demo https://bryntum.com/products/scheduler/examples/timeaxis/
See the code how it's made by clicking the code icon on the top-right corner
timeAxis : {
continuous : false,
generateTicks(start, end, unit, increment) {
const ticks = [];
while (start < end) {
if (unit !== 'hour' || start.getHours() >= 9 && start.getHours() <= 18) {
ticks.push({
id : ticks.length + 1,
startDate : start,
endDate : DateHelper.add(start, increment, unit)
});
}
start = DateHelper.add(start, increment, unit);
}
return ticks;
}
}
Hi,
Scheduler Pro version has Calendars that allows to set non-working time, in Scheduler you can use
https://bryntum.com/products/scheduler/docs/#Scheduler/feature/TimeRanges
and catch drop on restricted area in https://bryntum.com/products/scheduler/docs/#Scheduler/feature/EventDrag#event-beforeEventDropFinalize event handler
here is a demo of using the feature
https://bryntum.com/products/scheduler/examples/timeranges/
All the best,
Alex Lazarev
How to ask for help? Please read our Support Policy
We do not write the code in bounds of forum support. If you need help with development, contact us via bryntum.com/services