Setting Fullcalendar Cell Background Color

前端 未结 2 1254
孤城傲影
孤城傲影 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:49

    Well, you can do this.

    {
      title: 'Some title',
      start: new Date(2014, 8, 24, 10, 30),
      allDay: false,
      editable: false,
      backgroundColor: '#SomeColor',
      borderColor: '#SomeColor'
    },
    {
      title: 'Some title2',
      start: new Date(2014, 8, 24, 10, 30),
      allDay: false,
      editable: false,
      backgroundColor: '#SomeColor2',
      borderColor: '#SomeColor2'
    }
    

    In addition, you can set class name like this:

    {
      title: 'Teste1',
      start: new Date(y, m, d, 10, 30),
      allDay: false,
      editable: false,
      className: ["red"]
    },
    {
      title: 'Teste1',
      start: new Date(y, m, d, 10, 30),
      allDay: false,
      editable: false,
      className: ["green", "secondClass"]
    }
    

    Then describe that style of class

    
    

提交回复
热议问题