Google API的示例/演示代码对于更新活动标题非常明确,似乎每个人都喜欢将其复制到自己的教程中......我可以使用该示例轻松更新事件的标题,描述和位置,但我无法使用它更新“when”属性,该属性由具有开始和结束日期/时间的数组组成。Google Calendar API - 更新活动开始和结束日期/时间
下面的代码不返回一个错误,但它不更新的日期和时间,以及:
if ($eventOld = getEvent($client, $eventId)) {
//echo "Old title: " . $eventOld->title->text . "<br />\n";
$eventOld->title = $gdataCal->newTitle($title);
$eventOld->where = array($gdataCal->newWhere($where));
$eventOld->content = $gdataCal->newContent("$description");
$eventOld->when[startTime] = "{$startDate}T{$startTime}:00.000{$tzOffset}:00";
$eventOld->when[endTime] = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";
print $startDate;
try
{
$eventOld->save();
}
catch (Zend_Gdata_App_Exception $e)
{
var_dump($e);
return null;
}
//return $eventNew;
}
else
{
return null;
}