Page 1 of 1

Is it possible to constrain the date range of the Calendar?

Posted: Thu Feb 06, 2020 2:48 pm
by Gustav
I would like to be able to constrain the date range of the Calendar, like it is possible in Scheduler.

I can set date which is the date the calendar starts with, but I would also like to set a minDate and a maxDate that prevent the user from breaking out of this date range, so the various buttons get disabled when the min/max is reached.

Like the agenda view that only shows where is data, I would like the same for the other views.

Re: Is it possible to constrain the date range of the Calendar?

Posted: Fri Feb 07, 2020 3:55 pm
by mats
Not supported I'm afraid, but you can override these Calendar methods and block the calls as per your needs:

Code: Select all

/**
     * Will display next period in calendar.
     */
    shiftPrevious : function () {
        this.shiftPeriod(-1);
    },

    /**
     * Will display previous period in calendar.
     */
    shiftNext : function () {
        this.shiftPeriod(1);
    },

Re: Is it possible to constrain the date range of the Calendar?

Posted: Fri Feb 07, 2020 4:29 pm
by Gustav
I hoped there was an easier (more direct) way to do this, but will try. Thank you!