1

在 Zend Framework Google Calendar Api 的手册中,我找不到更新日期说明。

在文档中,我们有:

// Get the first event in the user's event list
$event = $eventFeed[0];

// Change the title to a new value
$event->title = $service->newTitle("Woof!");

// Upload the changes to the server
try {
    $event->save();
} catch (Zend_Gdata_App_Exception $e) {
    echo "Error: " . $e->getMessage();
}

但是我如何更新任何事件的 startDate 和 endDate ?

4

2 回答 2

1

在 Zend Framework (1.2) Google Calendar API 中更新事件日期可以正常工作

                $user = "xxxx@gmail.com";
                $pass = "12345@mapring";

                $service = Zend_Gdata_Calendar::AUTH_SERVICE_NAME;
                $client = Zend_Gdata_ClientLogin::getHttpClient($user, $pass, $service);
                $service = new Zend_Gdata_Calendar($client);

                $query = $service->newEventQuery();
                $query->setUser('default');


                /*to update your event*/
                $urlid = "https://www.google.com/calendar/feeds/default/private/full/tbc633h37hgv4s4u0ivl3eigak/63509906072";
                $event = $service->getCalendarEventEntry($urlid);
                // Change the title
                $event->title = $service->newTitle("New Title!");
                $event->save();
于 2013-07-19T08:43:32.037 回答
0

我从参考指南中获取了这个例子。

采埃孚参考指南

$start = new Zend_Date();
$end = new Zend_Date();
$end->addHour(2);

$when = $event->newWhen();

$when->startTime = $start->toString(Zend_Date::RFC_3339);
$when->endTime = $end->toString(Zend_Date::RFC_3339);

$event->when = array($when);
于 2013-02-26T03:45:01.233 回答