这很奇怪。我只是想用一个共享的谷歌日历来建立fullcalendar的基本功能。我试着简单地用我自己的日历URL替换gcal演示"gcal.html"。日历一开始就很好。这里有一些代码:
<head>
<link rel='stylesheet' type='text/css' href='../fullcalendar/fullcalendar.css' />
<link rel='stylesheet' type='text/css' href='../fullcalendar/fullcalendar.print.css' media='print' />
<script type='text/javascript' src='../jquery/jquery-1.7.1.min.js'></script>
<script type='text/javascript' src='../jquery/jquery-ui-1.8.17.custom.min.js'></script>
<script type='text/javascript' src='../fullcalendar/fullcalendar.min.js'></script>
<script type='text/javascript' src='../fullcalendar/gcal.js'></script>
<script type='text/javascript'>
$(document).ready(function() {
$('#calendar').fullCalendar({
header: {
left: 'prev,next today',
center: 'title',
right: 'month,basicWeek,basicDay'
},
// US Holidays
events: 'https://www.google.com/calendar/embed?src=r9k375tdhq8auc1oc4kgmhpri4%40group.calendar.google.com&ctz=America/Chicago',
eventClick: function(event) {
// opens events in a popup window
window.open(event.url, 'gcalevent', 'width=700,height=600');
return false;
},
loading: function(bool) {
if (bool) {
$('#loading').show();
}else{
$('#loading').hide();
}
}
});
});
</script>
我非常确信我拥有所有的依赖关系,等等,因为我在gcal演示中。当我将URL插入地址栏时,我的日历会以其他方式打开。此日历设置为公开日历。如有任何帮助,我们将不胜感激。如果我能让它发挥作用的话,完整的日历和谷歌日历似乎是一个很好的搭配。
您没有使用正确的URL。FullCalendar想要一个XML提要,而不是你给它的整个日历
请参阅文档。
尝试以下步骤:
你必须首先公开你的谷歌日历:
In the Google Calendar interface, locate the "My Calendar" box on the left. Click the arrow next to the calendar you need. A menu will appear. Click "Share this calendar." Check "Make this calendar public." Make sure "Share only my free/busy information" is unchecked. Click "Save."
然后,您必须获得日历的XML提要URL:
In the Google Calendar interface, locate the "My Calendar" box on the left Click the arrow next to the calendar you need. A menu will appear. Click "Calendar settings." In the "Calendar Address" section of the screen, click the XML badge. Your feed's URL will appear.
我相信这就是你想要的URL
https://www.google.com/calendar/feeds/r9k375tdhq8auc1oc4kgmhpri4%40group.calendar.google.com/public/basic