Skip to content

Instantly share code, notes, and snippets.

@DrewDouglass
Created November 8, 2017 18:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DrewDouglass/ef80da4be2bafe8f7ca514f0f94af9f2 to your computer and use it in GitHub Desktop.
Save DrewDouglass/ef80da4be2bafe8f7ca514f0f94af9f2 to your computer and use it in GitHub Desktop.
FullCalendar alternate calendar colors.
//Globla variable outside of all functions
var altColor = 1;
//Global function
function isEven(n) {
return n % 2 == 0;
}
//This goes inside the full calendar call
eventRender: function(event, element) {
if(isEven(altColor)) {
$(element).css("background-color", "red");
}
else {
$(element).css("background-color", "blue");
}
altColor++;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment