0
votes

I am implementing jQuery FullCalendar in my Symfony2 site but I need to be able to show events from two different sources, and highlight them in different colours so the front end user can differentiate between each type.

Currently, I am using this code in my calendar settings js to fetch events from a json file:

events:
   {
     url: 'calendarjson/events.json'
   },

Here is my events.json file, if it is any help:

[{"id":1,"title":"To Do","description":"Edited To Do text!View call log</a>","start":"2015-10-30 14:30:00","allDay":0},{"id":2,"title":"Test Reminder","description":"asfsafasfd","start":"2015-11-10 12:00:00","allDay":0}]

However, I need to be able to fetch data from another file which contains driver sheets for a removal company, so users can see what is coming up.

Is there a way to allow the calendar to use two different json files to grab events from and, preferably, implement different colours for the background of the event?

Thanks in advance

1

1 Answers

1
votes

From API:

$('#calendar').fullCalendar({

    eventSources: [

        // your event source
        {
            url: '/myfeed.php', // use the `url` property
            color: 'yellow',    // an option!
            textColor: 'black'  // an option!
        },
        {
            url: '/myfeed2.php', // use the `url` property
            color: 'yellow',    // an option!
            textColor: 'black'  // an option!
        }

        // any other sources...

    ]

});

http://fullcalendar.io/docs/event_data/events_json_feed/