2010-07-23 73 views
1

我剛剛下載FullCalendar今天,我一直在試圖結合JSON日曆與gcal。除了我的JSON數據,我還想顯示全國假期,有人可以告訴我這是否可能。jQuery FullCalendar結合JSON和GCAL

我試過這個,它不工作。謝謝!

$(文件)。就緒(函數(){

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

    $('#calendar').fullCalendar({ 
     header: { 
      left: 'prev,next today', 
      center: 'title', 
      right: 'month,basicWeek,basicDay' 
     }, 

     editable: true, 

     events: "json-events.php", 
       $.fullCalendar.gcalFeed('http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic'), 


     loading: function(bool) { 
      if (bool) $('#loading').show(); 
      else $('#loading').hide(); 
     } 
    }); 

}); 

回答

2

我發現answer here我更換事件與eventSources。萬一別人是看同樣的事情。

eventSources: [ 
    "json-events.cfm", 
    $.fullCalendar.gcalFeed('http://www.google.com/calendar/feeds/usa__en%40holiday.calendar.google.com/public/basic') 
] 
1

我這樣用:

eventSources: [ 

    "json/events.inc.php", 
    { url:'https://google.com/calendar/feeds/20929292', 
     className: 'fc-event'} 

]