Carlos Ost
Carlos Ost

Reputation: 512

fullCalendar - Change cell color of a period of time

I want to change cell color of a period of time. Ex: change to green, the color of the cells from 9 am to 11 am of the day 2016-01-20.

I've been searching for a solution about a week, but every tip is about changing all day using

$(".fc-day[data-date='2016-01-20']").css('background', 'green');

And that is not what I need.

regards.

Upvotes: 2

Views: 2316

Answers (1)

Carlos Ost
Carlos Ost

Reputation: 512

The new version of fullCalendar, provides a backgrouEvent

http://fullcalendar.io/docs/event_rendering/Background_Events/

$('#calendar').fullCalendar({
defaultDate: '2016-01-20',
defaultView: 'agendaWeek',
events: [
    {
        start: '2016-01-20T09:00:00',
        end: '2016-01-20T11:00:00',
        rendering: 'background'
    }
]});

Upvotes: 3

Related Questions