I'm using fullcalendar for a system where the user clicks on a day to bookmark a calendar. I need to leave the background of the day clicked with a certain color and this I found in the documentation how to do and is simple even, my problem here is when the user clicks on a second day, and with that the first day clicked should "delete" the background color and leave only the second day.
I even did it, but I guess not in the best way, if someone knows a better way to do that.
$(document).ready(function() {
var opt = {
dayClick : function(date, allDay, jsEvent, view) {
// seta todo background-color como branco
$('.fc-view-month > table > tbody > tr > td').css('background-color', '#fff');
// seta o background-color do dia clicado como vermelho
$(this).css('background-color', 'red');
}
};
$('.calendar').fullCalendar(opt);
});