【问题标题】:full calendar google event not showing完整的日历谷歌事件未显示
【发布时间】:2015-01-09 22:46:07
【问题描述】:

如果这个问题已经得到解答,我深表歉意,但我无法让我的日历显示我在谷歌日历中输入的事件。

有人可以看看我的代码并告诉我我缺少什么吗?

<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: 'lichfieldrooms@gmail.com',
                      className: 'gcal-event',
                        events: 'https://www.google.com/calendar/feeds/lichfieldrooms%40gmail.com/public/basic'
        }
    });
});

</script>

【问题讨论】:

  • 我认为您的 googleCalendarId 值不正确。从文档中,这个 ID 应该是look something like that 'abcd1234@group.calendar.google.com'
  • 也正如@iubema所说,ApiKey没有''。
  • 真的很奇怪。我所能看到的是(日历 ID:lichfieldrooms@gmail.com)我在任何地方都看不到上面提到的示例在我的设置中的任何地方:(
  • 您问题中的 CalendarID 格式与非公开日历的 ID 相同,可能是您未能公开日历。请参阅此处公开的步骤fullcalendar.io/docs/google_calendar
  • 我已按照完整日历网站上的所有说明公开我的日历。我也向谷歌报告了这个问题,但我不知道他们需要多长时间才能回复:(

标签: jquery fullcalendar


【解决方案1】:

查看您的代码以及完整日历和谷歌日历的文档似乎都可以,但我认为您的 ApiKey 不正确,请尝试在没有 '' 的情况下编写它。

编辑: 此外,在您的代码中,第二个事件应遵循以下格式http://fullcalendar.io/docs/event_data/Event_Source_Object/#options

【讨论】:

    【解决方案2】:

    不确定这是否有帮助,但每次我运行带有完整日历的谷歌日历时,我都没有在“事件”部分中包含谷歌“提要”。而是我这样称呼它:

    var gCalId = //your google calendar ID   
    var gApi = //your google API
    
    $(document).ready(function() {
    $('#calendar').fullCalendar({
    eventSources: [
                {
                    url: gCalId,    
                }
            ],
       });  
    
    
    });
    

    您也可以这样称呼它(假设您在其他地方包含 API):

    events: {   
       googleCalendarId: gCalId,
            },  
    

    我对此有点陌生,但那些一直对我有用。 来自 Full Calendar 的文档也通过省略来解释这一点,但如果您使用的是“Google Apps”日历而不是普通的“Google 日历”,那么您的公开共享选项将会有所不同。如果您使用的是“Google Apps”,您的管理员需要开启:

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

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

    在我的 Google Apps 帐户之外使用单独的 Google 日历当然可以,因为完整日历说明了如何仅使用普通的 Google 日历来执行此操作。

    如果这些信息有帮助,请告诉我?我是一名新手程序员,过去两周一直在与 Javascript、FullCalendar 和 Google API 搏斗。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-07-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多