Setting Fullcalendar Cell Background Color

前端 未结 2 1201
孤城傲影
孤城傲影 2021-02-06 00:29

I saw several topics on how to set the background color of a cell in fullcalendar, but none of them worked for me. I guess the calendar used to list the days using their date as

2条回答
  •  遥遥无期
    2021-02-06 00:44

    You can try to set event background color. Something like this:

    event.backgroundColor = 'cccccc#';
    

    Or for cell background:

    $('.fc-day[data-date="' + date + '"]').css('background', color);
    

    date must be date string equivalent to php Y-m-d date format. Style need change when calendar was rendered.

提交回复
热议问题