How do I use multiple sources with the jQuery plugin fullCalendar?

做~自己de王妃 提交于 2019-11-30 10:08:17

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')
],  

I was having the same issue and the idea above worked for me with a slight modification. I needed it to show 5 calendars on a page but only 1 calendar on a different page so I did this.

<?php if (is_page("calendar")):?>
 events:'...google calendar url #1...',
<?php endif; ?>

<?php if (is_page("meeting-schedule")):?>
  eventSources: [
    $.fullCalendar.gcalFeed('...google calendar url #1...'),
    $.fullCalendar.gcalFeed('...google calendar url #2...'),
    $.fullCalendar.gcalFeed('...google calendar url #3...'),
    $.fullCalendar.gcalFeed('...google calendar url #4...'),
    $.fullCalendar.gcalFeed('...google calendar url #5...')
  ],
<?php endif; ?>

Works perfectly!!!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!