you can use this code snippet in v1.x file
$('#calendar').fullCalendar({ dayClick: function (date, allDay, jsEvent, view) { $(".fc-state-highlight").removeClass("fc-state-highlight"); $(jsEvent.target).addClass("fc-state-highlight"); } });
V2.x
$('#calendar').fullCalendar({ dayClick: function (date, jsEvent, view) { $(".fc-state-highlight").removeClass("fc-state-highlight"); $(jsEvent.target).addClass("fc-state-highlight"); } });
CSS .fc-state-highlight {background:red;}
Note: this can be achieved in other ways, also using the data-date attribute for the cell parameter and date for the dayClick function
$('#calendar').fullCalendar({ dayClick: function (date, jsEvent, view) { $(".fc-state-highlight").removeClass("fc-state-highlight"); $("td[data-date="+date.format('YYYY-MM-DD')+"]").addClass("fc-state-highlight"); } });
valar morghulis
source share