Fullcalendar演示 - 多个Google日历

时间:2011-03-08 15:16:02

标签: fullcalendar

在Google日历演示中......

// US Holidays
events: $.fullCalendar.gcalFeed('http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic'),

我们可以像这样添加多个......

        // US Holidays
        events: $.fullCalendar.gcalFeed('http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic'),
        events: $.fullCalendar.gcalFeed('http://www.google.com/calendar/feeds/sfzc1%40realintelligence.com/public/basic'),

两者都没有出现......

我尝试了这个建议:

$(document).ready(function() {

    $('#calendar').fullCalendar({

        eventSources:[
            $.fullCalendar.gcalFeed('http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic'),
        $.fullCalendar.gcalFeed('http://www.google.com/calendar/feeds/sfzc1%40realintelligence.com/public/basic')
            ]


        eventClick: function(event) {
            // opens events in a popup window
            window.open(event.url, 'gcalevent', 'width=700,height=600');
            return false;
        },
        aspectRatio: 6,
        loading: function(bool) {
            if (bool) {
                $('#loading').show();
            }else{
                $('#loading').hide();
            }
        }

    });

});

不会渲染

3 个答案:

答案 0 :(得分:2)

尝试:

eventSources:
[
    url:'http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic',
    url:'http://www.google.com/calendar/feeds/sfzc1%40realintelligence.com/public/basic'
]

答案 1 :(得分:1)

您应该使用:

eventSources:
[
        $.fullCalendar.gcalFeed('http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic'),
        $.fullCalendar.gcalFeed('http://www.google.com/calendar/feeds/sfzc1%40realintelligence.com/public/basic')
]

答案 2 :(得分:1)

我同意,这些消息来源应该如下:

eventSources: [
        'http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic',
        'http://www.google.com/calendar/feeds/en.german%23holiday%40group.v.calendar.google.com/public/basic'
        ],

您可以在此处查看功能示例: http://jsfiddle.net/waffl/akbyW/

用颜色:

eventSources: [
        'http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic',
        {
            url: "http://www.google.com/calendar/feeds/en.german%23holiday%40group.v.calendar.google.com/public/basic",
            className: 'germany',
            color: 'red'
        }
        ],

http://jsfiddle.net/waffl/fKh6N/1/

确保来源是公共xml链接。