Issue 158: Restrict date range
Status:  ExportedToGithub
Owner: ----
Closed:  Aug 2015
Reported by naterow...@gmail.com, Oct 30, 2009
Is there a way to restrict the viewable dates, i.e. next 2 years only?
Nov 10, 2009
Project Member #1 adamrs...@gmail.com
this would be useful. will probably implement it similar to jqueryui:
http://docs.jquery.com/UI/Datepicker#option-maxDate

can't say *when* i will get to it though.
thanks,
adam
Status: Accepted
Labels: -Type-Defect Type-Enhancement
Nov 10, 2009
Project Member #2 adamrs...@gmail.com
 Issue 161  has been merged into this issue.
Nov 10, 2009
Project Member #3 adamrs...@gmail.com
just merged 2 issues. thanks for ideas
Dec 3, 2009
Project Member #4 adamrs...@gmail.com
 Issue 223  has been merged into this issue.
Feb 26, 2010
Project Member #5 adamrs...@gmail.com
 Issue 339  has been merged into this issue.
Mar 30, 2010
Project Member #6 adamrs...@gmail.com
 Issue 415  has been merged into this issue.
Nov 21, 2010
Project Member #7 adamrs...@gmail.com
 Issue 675  has been merged into this issue.
Mar 31, 2011
#8 Meats...@gmail.com
Until this is officially supported, anyone finding this issue you can mess around with the 'renderView' function to add this (around line 370 in fullcalendar.js v1.5).

I had to disable the previous button once a particular month was hit and I did this by placing the following after the 'today' button handling in the function:

var minDate =new Date(2011, 2, 1, 0, 0, 0, 0);
if (currentView.start <= minDate){
  header.disableButton('prev');
} else {
  header.enableButton('prev');
}

Should be able to modify this easily to disable the next button for dates 2+ years in the future...
Dec 8, 2011
#9 jianwei....@gmail.com
This is a very good suggestion, thank you making this suggestion and it helped me create a work around for a problem I have.

By the way, this is really great jquery date control.
Dec 8, 2011
#10 jianwei....@gmail.com
This is a very good suggestion, thank you making this suggestion and it helped me create a work around for a problem I have.

By the way, this is really great jquery date control.
Aug 13, 2013
Project Member #11 adamrs...@gmail.com
(No comment was entered for this change.)
Summary: Restrict date range (was: restrict date range)
Labels: -Type-Enhancement -Priority-Medium Type-Feature
Aug 14, 2013
Project Member #12 adamrs...@gmail.com
 Issue 1251  has been merged into this issue.
Aug 15, 2013
Project Member #13 adamrs...@gmail.com
 Issue 1274  has been merged into this issue.
Aug 15, 2013
Project Member #14 adamrs...@gmail.com
 Issue 1315  has been merged into this issue.
Aug 18, 2013
Project Member #15 adamrs...@gmail.com
 Issue 1449  has been merged into this issue.
Aug 24, 2013
Project Member #16 adamrs...@gmail.com
 Issue 1810  has been merged into this issue.
Aug 25, 2013
Project Member #17 adamrs...@gmail.com
 Issue 1949  has been merged into this issue.
Jan 17, 2014
#18 jbaff...@gmail.com
PR #149 implements this feature.
Jun 5, 2014
Project Member #19 adamrs...@gmail.com
A link to the PR by @jbafford:
https://github.com/arshaw/fullcalendar/pull/149
Jul 14, 2014
Project Member #21 adamrs...@gmail.com
 Issue 161  has been merged into this issue.
Dec 2, 2014
#22 jbaff...@gmail.com
I've created a branch that implements this for FullCalendar 2.x:

https://github.com/jbafford/fullcalendar/tree/feature/date-restrict-2.x

As compared to my original branch (in PR #149), this branch only adds the minDate and maxDate options to restrict navigation. It does not additionally restrict selection/dragging of events to the minDate/maxDate, as that can easily be done by setting an eventConstraint.
Jan 12, 2015
#23 juanbr...@gmail.com
jbaff...@gmail.com, how are the data passed to this new option? maybe using the moment() that already exists in fullcalendar?
Jan 20, 2015
#24 jbaff...@gmail.com
@23 juanbr...@gmail.com: you'd pass in the minDate and maxDate options into the configuration object you pass in to fullCalendar when you construct it. Something like:

$calendar.fullCalendar({
    ...
    minDate: minDate,
    maxDate: maxDate,
    eventConstraint: {
        start: minDate,
        end: maxDate
    }
]);
Apr 19, 2015
Project Member #25 adamrs...@gmail.com
 Issue 2468  has been merged into this issue.
Apr 20, 2015
#26 abhidada...@gmail.com
What about doing in this way
May 2015 Enabled
June 2015 Disabled first week and 3rd week 
and so on 
Aug 21, 2015
Project Member #27 adamrs...@gmail.com
Discussion for this issue has moved to the following URL:
https://github.com/fullcalendar/fullcalendar/issues/429

This is because Google Code is shutting down. Apologies if you are being pestered with these notifications. This is a one-time event.

Happy coding,
Adam
Status: ExportedToGithub