【问题标题】:Google Calendar JSON API not showing all eventsGoogle Calendar JSON API 未显示所有事件
【发布时间】:2012-11-15 01:23:54
【问题描述】:

我一直在使用 Google Calendar JSON API,到目前为止一切正常。我唯一的问题是它没有引入所有事件,只是无缘无故地引入了其中一些事件。

这是我正在使用的代码:

$.getJSON("http://www.google.com/calendar/feeds/weimar.org_cnijr5sa383f7kl28eu63996ec%40group.calendar.google.com/public/full?alt=json-in-script&max-results=25&singleevents=false&futureevents=true&sortorder=ascending&orderby=starttime&callback=?",

function(json){

var html = '<ul id="event_feed">';

$.each(json.feed.entry,function(i,entry) {

html += '<li><h3><span class="event_month">' + $.format.date(entry['gd$when'][0].startTime + ' 00:00:00.000', "MMM") + '</span><span class="event_day">' + $.format.date(entry['gd$when'][0].startTime + ' 00:00:00.000', "dd") + '</span></h3><p>' + entry.title.$t + '<br /></p><div class="clear"></div></li>';

})

html += '</ul>';

$('#calendar').html(html);

});

与日历小部件(在 JSON 输出下方)相比,您可以看到 JSON 输出的内容。
http://weimar.edu/news/calendarapi 例如,只显示一个“大学日”。

【问题讨论】:

    标签: jquery json api events google-calendar-api


    【解决方案1】:

    您将参数设置为max-results=25 - 您有超过 25 个事件吗?

    看看@the documentation。您可能需要使用 start-index 浏览结果

    【讨论】:

      【解决方案2】:

      删除

      max-results=25
      

      futureevents=true
      

      然后它会带来所有的事件

      【讨论】:

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