Adding nice colors to events in FullCalendar (jquery)
In my calendar I want to colour each event in a different colour. Is there current开发者_运维知识库ly a way to send to the full calendar, in the JSON it expects a value for a colour?
FullCalendarSeems 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 */
}
.
.
.
.
This is now deprecated - for each event you should pass through the color and the font color. http://arshaw.com/fullcalendar/docs/event_data/Event_Object/#color-options
精彩评论