JonnyIrving
JonnyIrving

Reputation: 753

Adding data based formatting to the FullCalendar jquery plugin events

I am currently using the calendar to display volunteering opportunities. These volunteering opportunities only have a certain number of places and so eventually the opportunity will become full. When there are no more places left on a particular opportunity I would like the corresponding calendar event to change background colour (i.e places == 0).

I have altered the fetch method in my PHP to include the number of places so the FullCalendar plugin now gets handed:

{
    title: 'Cal Give Back Test With Space',
    start: new Date(2012, 7, 20),
    url: 'opportunityDetailUsr.php?id=4&gid=153',
    places:15
},

I'm unsure after a lot of fiddling as to what areas I need to adjust to achieve my desired change. If anyone with a better understanding of the plugin could shed some light on this for me it would be greatly appreciated.

Upvotes: 2

Views: 746

Answers (1)

ganeshk
ganeshk

Reputation: 5621

I think you can achieve this using the eventRender callback. Take a look at this fiddle: http://jsfiddle.net/100thGear/MpfGX/

Let me know if this helps!

Upvotes: 1

Related Questions