views:

943

answers:

1

Hi there,

I've got a functional fullCalendar http://arshaw.com/fullcalendar/ working retrieving a single source from Google Calendar for the events like so:

$('#calendar').fullCalendar({

   events: $.fullCalendar.gcalFeed(
      "http://www.google.com/calendar/feeds/etc",   // feed URL
      { className: 'gcal-events' }                  // optional options
   )

     });

My challenge is however to have multiple feeds coming in. The fullCalendar documentation says:

eventSources: Array Similar to the 'events' options, except one may specify multiple sources. For example, one may specify an array of JSON URL’s, an array of custom functions, an array of hardcoded event arrays, or any combination.

But there is no example and so this JSON newbie here is a little bit stuck.

Any ideas on what it would need to use eventSources and an array of the feeds?

+3  A: 

Found solution here; http://code.google.com/p/fullcalendar/issues/detail?id=192&q=eventSources

eventSources:
[
  'msCal.txt', // location of Cal JSON script
 'msLogBook.txt', // location of LogBook JSON object
 'msEvents.txt' //location of the Events JSON object
]

Painfully simple in retrospect. The following is working on my test page;

eventSources:
[
 $.fullCalendar.gcalFeed('http://www.google.com/calendar/feeds/en.australian%23holiday%40group.v.calendar.google.com/public/basic'),
 $.fullCalendar.gcalFeed('http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic'),
 $.fullCalendar.gcalFeed('http://www.google.com/calendar/feeds/en.indonesian%23holiday%40group.v.calendar.google.com/public/basic')
],
Tyronomo
genius in its simplicity :) tx Tyronomo
cosmicbdog
Tyronomo, glad you got this to work. I am the creator of FullCalendar, and I want to begin keeping track of all FullCalendar-related questions on StackOverflow. Would you be so kinda as to edit this post, and add the tag "fullcalendar"? I'm gong to start monitoring this tag, it would be a great help. thanks!
arshaw
arshaw, I will add is similar comment to the question asking cosmicbdog to update. There are no tags for answers. :(
Tyronomo
cosmicbdog
But how do you add these sources, dynamically?
crosenblum
I have not used fullcalendar for a while, and no longer have my test page to check. But I would imagine you could edit/update/replace the eventSources array then redraw/refresh the calendar object. Sounds OK in my head, tho I have been using grids and datasourses for the last couple months, I could be completely wrong :P
Tyronomo