用于日历的Google Javascript数据API-事件时间不可用

用于日历的Google Javascript数据API-事件时间不可用,javascript,gdata,Javascript,Gdata,我想使用gdataapi从公共日历提要中检索一些事件条目。以下是我正在使用的代码: var calendarService = new google.gdata.calendar.CalendarService('GoogleInc-jsguide-1.0'); var feedUri = 'http://www.google.com/calendar/feeds/.../public/basic'; var gquery = new google.gdata.calendar.Calenda

我想使用gdataapi从公共日历提要中检索一些事件条目。以下是我正在使用的代码:

var calendarService = new google.gdata.calendar.CalendarService('GoogleInc-jsguide-1.0');

var feedUri = 'http://www.google.com/calendar/feeds/.../public/basic';
var gquery = new google.gdata.calendar.CalendarEventQuery(feedUri);

gquery.setFutureEvents(true);
gquery.setMaxResults(10);

var callback = function(result) {       
    var entries = result.feed.entry;    
    for (var i = 0; i < entries.length; i++ ) {
      var entry = entries[i];
      var title = entry.getTitle().getText();
      var times = entry.getTimes();
      alert("Title: " + title + " | Times: " + times);
    }    
}
calendarService.getEventsFeed(gquery, callback);  
var calendarService=new google.gdata.calendar.calendarService('GoogleInc-jsguide-1.0');
var feedUri=http://www.google.com/calendar/feeds/.../public/basic';
var gquery=new google.gdata.calendar.CalendarEventQuery(feedUri);
gquery.setFutureEvents(true);
gquery.setMaxResults(10);
var callback=函数(结果){
var条目=result.feed.entry;
对于(变量i=0;i
(提要URI是Google应用程序日历的公共(或私有)XML提要)

我希望以次为单位找到事件时间,但它是一个空数组。这在某种程度上是合乎逻辑的,因为feedUri中的实际提要不包含任何时间信息

问题:

  • 我做错了什么?如何检索包含事件时间的日历条目
  • 如果getTimes()方法完全无用,为什么会有它呢

编辑:我刚刚看到您正在使用“基本”提要-您是否尝试过使用“完整”提要?基本提要的描述如下:

没有任何扩展的基本Atom提要 元素。及其及 属性包含 预呈现HTML

此外,您需要了解单个事件与重复事件。有关重复事件的信息可通过
getRecurrence()
获得。对于单个事件,
getTimes()
将提供正确的信息

如果您没有通过API看到信息,请尝试直接查看源数据,看看是否可以在那里看到