Change the day background color in FullCalendar

后端 未结 2 886
走了就别回头了
走了就别回头了 2020-12-06 21:39

I\'m using FullCalendar in my asp.net application. I need to change the day background color.

What i have tried so far :

         


        
2条回答
  •  庸人自扰
    2020-12-06 22:19

    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/

提交回复
热议问题