Oli*_*Oli 5 php zend-framework google-calendar-api
我正试图通过Google日历帐户显示接下来20天的活动列表.令人不安的反复发生的事件没有显示(我假设因为他们的开始时间已经很久了)......所以.有任何想法吗?
require_once dirname(__FILE__).'/../../../Zend/Loader.php';
Zend_Loader::loadClass('Zend_Gdata');
Zend_Loader::loadClass('Zend_Gdata_HttpClient');
Zend_Loader::loadClass('Zend_Gdata_Calendar');
$service = new Zend_Gdata_Calendar();
$query = $service->newEventQuery();
$query->setUser('REMOVED');
$query->setVisibility('public');
$query->setProjection('full');
$query->setOrderby('starttime');
$query->setSortOrder('ascending');
$query->setFutureevents('true');
$query->setMaxResults(20);
try { $eventFeed = $service->getCalendarEventFeed($query); }
catch (Zend_Gdata_App_Exception $e) { return; }
Run Code Online (Sandbox Code Playgroud)
我愿意接受任何以升序排列所有公共事件的替代方法.我尝试过RSS,但日期似乎是他们被添加到日历中的时间.
投影是我以前玩过的东西.它没有帮助(除非我想手动解析和爆炸重复事件).但这种联系是金色的.
$query->setParam('singleevents','true');
Run Code Online (Sandbox Code Playgroud)
从他们的文档:
singleevents
指示是应将周期性事件展开还是表示为单个事件.
有效值为true(扩展重复事件)或false(将重复事件保留为单个事件).默认值为false.
在我看来,这false是一个愚蠢的默认,但嘿嘿.它似乎现在工作!
| 归档时间: |
|
| 查看次数: |
3037 次 |
| 最近记录: |