Change the day background color in FullCalendar

后端 未结 2 884
走了就别回头了
走了就别回头了 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条回答
  •  萌比男神i
    2020-12-06 22:21

    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");
    
                                }
    
                            }
    

提交回复
热议问题