问题
I would like to change the color of the past events, I guess I need to add a class to them but that is the problem, how I do that?
回答1:
it would be best to add the class to the "className" attribute of the event object http://arshaw.com/fullcalendar/docs/event_data/Event_Object/
回答2:
As per FullCalendar v1.6.4
Style past events in css:
.fc-past{background-color:red;}
Style future events in css:
.fc-future{background-color:red;}
回答3:
I did it (hard coding):
Before rendering:
var hoy = new Date;// get today's date hoy = parseInt((hoy.getTime()) / 1000); //get today date in unix
When creating the html, inside the "for":
unixevent = parseInt((event.end.getTime()) / 1000) //event date in Unix if (unixevent < hoy) {className += 'fc-passed ';} //add class if event is old
Add a new "fc-passed" class in the css file.
来源:https://stackoverflow.com/questions/4016044/adding-a-class-to-past-events-using-fullcalendar-with-google-calendar