【发布时间】:2010-07-31 16:54:00
【问题描述】:
我在使用 Google 日历 API 时遇到了一个奇怪的问题(通过 PHP 和 Zend_Gdata。)在有问题的日历上,我从 3 月开始有几个重复事件:
- 2010-04-19 9:30 - 16:00
- 2010-04-20 10:00 - 15:30
- 2010-04-21 9:30 - 16:00
- 2010-04-22 10:00 - 15:30
- 2010-04-23 9:30 - 12:30
这些中的每一个都无限期地重复,但在某些日子有例外。我的问题是在2010-07-15 之后API 没有返回任何取消或修改的实例。在 8 月 2 日这一周,所有 5 次重复都将被取消,它们会在 Google 日历中显示,但 API 不会返回这几天的异常。
我正在使用以下代码查询日历:
$gc = new Zend_Gdata_Calendar($client);
$query = $gc->newEventQuery();
$query->setUser(/*calendar ID goes here*/);
$query->setVisibility('private');
$query->setProjection('full');
$query->setOrderby('starttime');
$query->setSortorder('ascending');
$query->setMaxResults(500);
$query->setSingleEvents("false");
$query->setStartMin('2010-06-01 00:00:00');
$query->setStartMax('2010-09-20 00:00:00');
$query->setQuery(/*title of the events*/);
return $gc->getCalendarEventFeed($query);
生成的提要包含所有 5 次重复事件,以及所有已删除实例的“已取消”事件对象,直到 2010-07-15 任意停止。我应该注意,每次重复的 getWhen() 数组包含正确的时间(即它省略了取消的日期),但由于我的程序的编码方式,重要的是我可以访问实际取消的事件对象。
什么可能导致 API 不返回所有取消/修改的事件?最大结果不是问题,因为提要中只有大约 30 个事件。我基本上没有想法。
提前致谢。
【问题讨论】:
标签: php google-calendar-api zend-gdata