0

我使用 FullCalendar jquery,我想将德国假期添加到日历和一些像这样的事件:

$(document).ready(function() {

        var date = new Date();
        var d = date.getDate();
        var m = date.getMonth();
        var y = date.getFullYear();

        $('#calendar').fullCalendar({
            editable: false,


                events:  [
        {
    url: 'http://www.google.com/calendar/feeds/german%40holiday.calendar.google.com/public/basic',
    color: 'yellow',   // an option!
    textColor: 'black' // an option!
},

  {
       start: '2013-06-26',
        title: 'Mitrache Florin' , color: 'green', url: 'calendar.php?nume=Mitrache Florin', desc: 'test', 
         description:'' },   {
       start: '2013-06-27',
        title: 'Mitrache Florin' , color: 'green', url: 'calendar.php?nume=Mitrache Florin', desc: 'test', 
         description:'' }, 
]
});

    });

但不显示德国假期。jsfiddle http://jsfiddle.net/DKvCR/

解决方案: FullCalendar Jquery

4

1 回答 1

1

尝试

$(document).ready(function() {

    var date = new Date();
    var d = date.getDate();
    var m = date.getMonth();
    var y = date.getFullYear();

    $(document).ready(function() {
        $('#calendar').fullCalendar({
            eventSources:[{
                url: 'http://www.google.com/calendar/feeds/german%40holiday.calendar.google.com/public/basic',
                color : 'grey', // an option!
                textColor : 'black' // an option!
            }, {
                events : [{
                    start : '2013-06-26',
                    title : 'Mitrache Florin',
                    color : 'green',
                    url : 'calendar.php?nume=Mitrache Florin',
                    desc : 'test',
                    description : ''
                }, {
                    start : '2013-06-27',
                    title : 'Mitrache Florin',
                    color : 'green',
                    url : 'calendar.php?nume=Mitrache Florin',
                    desc : 'test',
                    description : ''
                }]
            }]
        });
    });

});

演示:小提琴

于 2013-07-01T12:14:03.053 回答