FullCalendar: Change agendaDay background-color

后端 未结 6 731
感情败类
感情败类 2020-12-29 13:09

While I have seen this question asked, I haven\'t seen the answer. I just want to be able to color the background-color of the TD from a certain ra

6条回答
  •  不知归路
    2020-12-29 13:42

    I wrote some simple annotation support to do this kind of feature, it can be found from

    https://github.com/elhigu/fullcalendar

    Hopefully it gets to be merged to official branch at some point

    Annotations can be added like this:

        $('#calendar').fullCalendar({
            ....
            events: [
                {
                    title: 'All Day Event',
                    start: new Date(y, m, 1)
                }
            ],
            annotations: [{
                    start: new Date(y, m, d, 13, 0),
                    end: new Date(y, m, d, 15, 30),
                    title: 'My 1st annotation', // optional
                    cls: 'open', // optional
                    color: '#777777', // optional
                    background: '#eeeeff' // optional
                }, { next annotation }, ...]        
        });
    
    })
    

    Full example how to use the annotations can be found here: https://github.com/elhigu/fullcalendar/blob/master/demos/annotations.html

    enter image description here

提交回复
热议问题