I would like to use the gdata API to retrieve some event entries from a public calendar feed. Here is the code that I'm using:
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);
(Feed URI is the public (or private) XML-Feed for a Google Apps Calendar)
I expected to find the event times in times but it is an empty array. Which is in some way logical, because the actual feed in feedUri doesn't contain any time information.
Questions:
- What am I doing wrong? How to retreive calendar entries which include event times?
- Why is there a method getTimes() if it's completely useless?