views:

629

answers:

1

In my calendar I want to colour each event in a different colour. Is there currently a way to send to the full calendar, in the JSON it expects a value for a colour?
FullCalendar

+1  A: 

Seems I missed it the first time I read the manual:

I send for each day the following JSON:

{"id":"1",
"start":"1272513600",
"end":"1272513600",
"allDay":"1",
"title":"Repeat 1,Day 1",
"className":"eventColorX"}

The important thing is the className and where the X is a number (depends on the CSS, see below).
And then in the CSS:

.eventColor1,
.fc-agenda .eventColor1 .fc-event-time,
.eventColor1 a {
    background-color: green; /* background color */
    border-color: green;     /* border color */
    color: yellow;           /* text color */
    }

.eventColor2,
.fc-agenda .eventColor2 .fc-event-time,
.eventColor2 a {
     background-color: purple; /* background color */
     border-color: purple;     /* border color */
     color: white;           /* text color */
     }


.
.
.
.
Itay Moav