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

Ask for help related to our Calendar 2.x version
Post Reply
User avatar
Gustav
Posts: 7
Joined: Fri May 25, 2012 2:49 pm

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

Post 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.

User avatar
mats
Core Developer
Core Developer
Posts: 16563
Joined: Sat Dec 19, 2009 11:41 pm
Location: Sweden
Contact:

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

Post 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);
    },
Tired of debugging javascript errors in web applications? Try our new error logging service RootCause, or read more on the Sencha blog

@bryntum
Facebook
API documentation

User avatar
Gustav
Posts: 7
Joined: Fri May 25, 2012 2:49 pm

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

Post by Gustav »

I hoped there was an easier (more direct) way to do this, but will try. Thank you!

Post Reply