I have a couple of json feeds that I'd like to display on the calendar.
Looking at the docs there does seem some explanation, but no example of having more than 1 json feed.
I have the following:
var source = Array();
source[0] = '/feed1.php';
source[1] = '/feed2.php';
eventSources: [
source[0],
source[1]
]
This displays the events fine and I can seem them on my calendar
But how would I differentiate between them in terms of colors?
Thanks
You can use the extended form of event sources to give each source its own color. In the code below, "color" is the event background color and "textColor" is the color of the event text.
$('#calendar').fullCalendar({
header: {
left: 'prev,next',
center: 'title',
right: 'today'
},
eventSources: [
{
url: '/feed1.php',
color: 'yellow',
textColor: 'black'
},
{
url: '/feed2.php',
color: 'blue',
textColor: 'white'
}
]
});
Here's a JSFiddle that uses this method: http://jsfiddle.net/emcw5/4/.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With