Get Calendar events between two dates

ぃ、小莉子 提交于 2019-12-05 18:14:37

问题


How to get all events between two specific dates. For example i only want to get events between 1st of March 2013 & 28th of March 2013.

I am using Google Calendar API v3. While in Google Calendar API v1 there was the facility for search between 2 dates using start-min & start-max. I am wondering what is the replacement for these two parameters in Google Calendar API v3?


回答1:


Ok i got the answer. The new parameters in Google API V3 are timeMin & timeMax to filter events between 2 dates.




回答2:


Just add these two parameters to the query before getting the event feed:

// Start date from where to get the events
$query->setStartMin('2013-01-01');
// End date
$query->setStartMax('2013-03-20');

For further reference see: Retrieve events occuring between a date range

Hope this helps.



来源:https://stackoverflow.com/questions/15516985/get-calendar-events-between-two-dates

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!