FullCalendar rendering background color in month view

4.5k views Asked by At

I use the following way to put new events in my calendar:

$.each(daten.variable, function(i, v){
    var newEvent = new Object();
    //
    newEvent.typ = 'Abwesenheit';
    newEvent.start = von;
    newEvent.end = bis;
    newEvent.rendering = 'background';
    newEvent.backgroundColor = 'red';
    //
    $('#id').fullCalendar('renderEvent', newEvent, true);
})

This works fine for the day view and the week view. But it does not work for the month view. How can I render the background event for the month view?

1

There are 1 answers

2
A1rPun On

.rendering = 'background'; is only shown in the month view when the event is an allDay event. So add this property to your objects:

newEvent.allDay = true;

Here is a jsfiddle to show that background events work in month view.