I have a date in the future which is always 30 days ahead of the current date. It\'s stored in a Date object. I worked this out using:
var currentDate = new
this one chose the current month period
$('#calendar').fullCalendar({
header: {
left: 'prev,next',
center: 'title',
right: 'today'
},
defaultDate: moment(),
editable: false,
//height:'auto',
//weekends: false,
defaultView: 'agendaWeek',
eventLimit: true,
events: {
url: 'php/get-events.php',
error: function() {
$('#script-warning').show();
}
},
loading: function(bool) {
$('#loading').toggle(bool);
},
viewRender: function(view,element) {
var now = new Date();
var end = new Date();
end.setMonth(now.getMonth());
end.setDate();
now.setDate(1);
if ( end < view.end) {
$("#calendar .fc-next-button").hide();
return false;
alert(end);
}
else {
$("#calendar .fc-next-button").show();
}
if ( view.start < now) {
$("#calendar .fc-prev-button").hide();
return false;
}
else {
$("#calendar .fc-prev-button").show();
}
}
});
});