| Issue 415: | Enable limiting of months to display | |
| 1 person starred this issue and may be notified of changes. | Back to list |
I have a need to limit the use of the calendar to four months in 2011. After looking through the documentation and the js file, I dont think this is currently possible. As a quick fix, does anyone have any ideas? Thanks.
Jul 15, 2013
I was searching for it. And found a doable code, may this help you and others bcoz its working perfect for me.
jQuery('#edit-calendar').fullCalendar({
viewDisplay : function(view) {
var now = new Date();
var end = new Date();
end.setMonth(now.getMonth() + 11); //Adjust as needed
var cal_date_string = view.start.getMonth()+'/'+view.start.getFullYear();
var cur_date_string = now.getMonth()+'/'+now.getFullYear();
var end_date_string = end.getMonth()+'/'+end.getFullYear();
if(cal_date_string == cur_date_string) { jQuery('.fc-button-prev').addClass("fc-state-disabled"); }
else { jQuery('.fc-button-prev').removeClass("fc-state-disabled"); }
if(end_date_string == cal_date_string) { jQuery('.fc-button-next').addClass("fc-state-disabled"); }
else { jQuery('.fc-button-next').removeClass("fc-state-disabled"); }
}
});
Best Regards
~Frank
|
|
| ► Sign in to add a comment |
Mergedinto: 158