java中Google日历api(V3)中指定日期的所有事件列表?
我想做的是在给定的google日历中获取给定日期的所有事件。 现在,我们可以使用以下代码非常轻松地获得事件列表java中Google日历api(V3)中指定日期的所有事件列表?,java,google-calendar-api,google-data-api,Java,Google Calendar Api,Google Data Api,我想做的是在给定的google日历中获取给定日期的所有事件。 现在,我们可以使用以下代码非常轻松地获得事件列表 public Events getAllEvent() { Events events= null ; try { events = service.events().list(this.calendarID).execute(); } catch (IOException e) { // TODO Auto-generat
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 Sameer当前API不包含此功能。但您可以在此处提出功能请求。
一旦谷歌工程师亲自监控,你会得到一些肯定的答复。Sameer目前API不包含此功能。但您可以在此处提出功能请求。
一旦谷歌工程师亲自监控,你会得到一些肯定的答复。你好,我找到了我的问题的答案,因此在这里为其他人更新。 这是可以做到的。虽然我们并没有直接的方法,但可以使用查询参数来实现。比如说,如果我们希望从今天开始提供事件提要,而不是早于今天。然后我们可以这样做
Events events = service.events().list(calendarID).setTimeMin("2012-01-01T00:00:00Z").execute();
而不是
events = service.events().list(this.calendarID).execute();
从2031年到2031年的所有信息
要在日期之间获取提要,请同时使用setTimemin和setTimeMax
希望这有助于其他人干杯…你好,我找到了我问题的答案,因此在此为其他人更新。 这是可以做到的。虽然我们并没有直接的方法,但可以使用查询参数来实现。比如说,如果我们希望从今天开始提供事件提要,而不是早于今天。然后我们可以这样做
Events events = service.events().list(calendarID).setTimeMin("2012-01-01T00:00:00Z").execute();
而不是
events = service.events().list(this.calendarID).execute();
从2031年到2031年的所有信息
要在日期之间获取提要,请同时使用setTimemin和setTimeMax
希望这有助于其他人欢呼…下面列出的是使用Oauth2的Google API 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();
下面列出了使用Oauth2为Google API的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();
您好,谢谢您的回答,您知道如何在Objective-C(我指的是XCode,IOS开发)的情况下设置TimeMin,因为我可以在尝试使用Google API Explorer时获得结果,但同样的错误是“error”:{“errors”:[{“domain”:“global”,“reason”:“badRequest”,“message”:“Bad Request”}],“code”:400,“message”:“Bad Request”}@ShafKhan-u可能正在发送“global”或访问全局列表,而不是将其更改为“primary”列表。您能解释一下“2012-01-01T00:00:00Z”中的T和Z是什么意思吗?您好,谢谢您的回答,您知道在Objective-C(我指XCode,IOS开发)的情况下如何设置TimeMin吗,因为当我尝试使用Google API Explorer时,我可以得到结果,但同样的错误是“error”:{“errors”:[{“domain”:“global”,“reason”:“badRequest”,“message”:“Bad Request”}],“code”:400,“message”:“Bad Request”}@ShafKhan-u可能是在“global”中发送的或者访问全局列表,改为“主”列表。您能解释一下“2012-01-01T00:00:00Z”中的T和Z是什么意思吗?