I\'m using FullCalendar in my asp.net application. I need to change the day background color.
What i have tried so far :
You can do it like this:
dayRender: function (date, cell) {
var today = new Date();
var end = new Date();
end.setDate(today.getDate()+7);
if (date.getDate() === today.getDate()) {
cell.css("background-color", "red");
}
if(date > today && date <= end) {
cell.css("background-color", "yellow");
}
}
http://jsfiddle.net/z8Jfx/7/
dayRender : function(date, cell) {
var idx = null;
var today = new Date().toDateString();
var ddate = date.toDate().toDateString();
if (ddate == today) {
idx = cell.index() + 1;
cell.css("background-color", "azure");
$(
".fc-time-grid .fc-bg table tbody tr td:nth-child("
+ idx + ")").css(
"background-color", "azure");
}
}