在Google Calender api(V3)中指定日期的所有活动列表?

我想要做的是获取给定日期的给定谷歌日历中的所有事件

现在,我们可以使用以下代码轻松获取事件列表

public Events getAllEvent() { Events events= null ; try { events = service.events().list(this.calendarID).execute(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return events ; } 

我应该如何转换这个函数,以便它只在我指定的那一天给出事件。 我尝试了很多方法,但是在版本3中它不像在v2中那样工作。 任何建议。 请记住,我们正在谈论谷歌日历Api版本3

嗨,我找到了我的问题的答案,所以在这里为其他人更新。 这可以做到。 虽然我们没有直接的方法,但我们可以使用查询参数来完成它。 如果我们想要从今天开始并且不早于今天开始提供事件,请说明。 然后我们可以做到这一点。

 Events events = service.events().list(calendarID).setTimeMin("2012-01-01T00:00:00Z").execute(); 

代替

  events = service.events().list(this.calendarID).execute(); 

它只是给我们所有的饲料,直到2031年。

要在日期之间获取Feed,请同时使用setTimemin和setTimeMax

希望这有助于有人欢呼……

下面列出了使用Oauth2将Google日历服务用于v3的代码。 我发布了它,因为谷歌在他们的网站上记录错误。

 Calendar service3 = new Calendar(transport, jsonFactory, accessProtectedResource); com.google.api.services.calendar.model.Calendar calendar = service3.calendars().get("primary").execute(); com.google.api.services.calendar.model.Events events = service3.events().list("primary").execute(); 

Sameer目前的API不包括此function。 但您可以在此处发布function请求Apis问题跟踪器 。
由Google工程师自己监控,您很快就会收到一些肯定的答复。