2015-01-09 43 views
0

我很抱歉,如果这已被回答,但我很难让我的日历显示我已经在谷歌日历中输入的事件。全日历谷歌事件没有显示

有人可以看看我的代码,并告诉我我失踪了什么?

<link rel='stylesheet' href='fullcalendar-2.2.5/fullcalendar.css' /> 
<script src='fullcalendar-2.2.5/lib/jquery.min.js'></script> 
<script src='fullcalendar-2.2.5/lib/moment.min.js'></script> 
<script src='fullcalendar-2.2.5/fullcalendar.js'></script> 

<script type='text/javascript' src='fullcalendar-master/dist/gcal.js'></script> 

<script type='text/javascript'> 

      $(document).ready(function() { 
       $('#calendar').fullCalendar({ 
       googleCalendarApiKey: '<AIzaSyD6vDNaab25QZdjAqggmjT1_BvCa_9WeEY>', 
       events: { 
       googleCalendarId: '[email protected]', 
         className: 'gcal-event', 
         events: 'https://www.google.com/calendar/feeds/lichfieldrooms%40gmail.com/public/basic' 
     } 
    }); 
}); 

</script> 
+0

我认为你的'googleCalendarId'值不正确。从文档中,这个Id应该看起来像'abcd1234 @ group.calendar.google.com'' – 2015-01-09 23:55:15

+0

也是@iubema所说的,ApiKey没有'<', '>'。 – 2015-01-09 23:58:23

+0

这真的很奇怪。我只能看到(日历ID:[email protected])我的设置在任何地方都看不到任何地方:( – 2015-01-10 18:28:07

回答

0

不知道这是否会有所帮助,但我一直在运行带有完整的日历谷歌日历每一次我都没有包括谷歌“事件”部分中的“提要”。而是我把它称为像这样:

var gCalId = //your google calendar ID 
var gApi = //your google API 

$(document).ready(function() { 
$('#calendar').fullCalendar({ 
eventSources: [ 
      { 
       url: gCalId,  
      } 
     ], 
    }); 


}); 

您也可以这样调用它(假设你是包括其他地方的API):

events: { 
    googleCalendarId: gCalId, 
     }, 

我在它像是新的,但那些已经为我工作。 此外,完整日历的文档通过省略对此进行了解释,但如果您使用的是“Google Apps”日历而不是普通的“Google日历”,则您的公共共享选项将有所不同。如果您正在使用“谷歌企业应用套件”你的管理员将需要打开:

“共享所有信息,并允许管理日历” OR “共享所有信息,但外人无法变更日历” 这些都是在管理控制台 - >在Google Apps-> Google日历下。 在您调整此设置后,您可以返回到Google Apps日历上的“共享”设置,然后选中“公开此日历”,然后选择“查看所有活动详情”。

否则,您的完整日历将只显示事件栏,但不会显示标题或任何其他信息。

在我的Google Apps帐户外部使用单独的Google日历当然工作,因为完整日历解释了如何使用普通的Google日历执行此操作。

让我知道这些信息是否有帮助?我是一位新手程序员,在过去的两周里一直在使用Javascript,FullCalendar和Google API。