Our pure JavaScript Scheduler component


Post by etaveira »

 How can I restrict the Scheduler to only allow the dates I specify?


Post by ghulam.ghous »

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;
            }
        }

Post by etaveira »

Thank you Ghulam. So, actually I would like just to disable the columns that's not in the range date, is that possible?


Post by ghulam.ghous »

Can you please show a picture or clip indicating what you meant by the column that is not in the range?


Post by etaveira »

I attached a image, please check

Attachments
Screenshot 2025-04-17 at 08.41.33.png
Screenshot 2025-04-17 at 08.41.33.png (100.77 KiB) Viewed 89 times

Post by alex.l »

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


Post Reply