Skip to content

Instantly share code, notes, and snippets.

@noahlh
Created June 6, 2013 20:29
Show Gist options
  • Save noahlh/5724658 to your computer and use it in GitHub Desktop.
Save noahlh/5724658 to your computer and use it in GitHub Desktop.
FullCalendar function to "grey out" days before the current date (it does this by applying the 'fc-other-month' style, which is what is used for dates that appear in another month). Uses the moment.js library to (more easily) manipulate date objects.
$('#calendar').fullCalendar({
// Other Calendar Options go here
viewDisplay: function(view){
$('.fc-day').filter(
function(index){
return moment( $(this).data('date') ).isBefore(moment(),'day')
}).addClass('fc-other-month');
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment