2 messages in com.googlegroups.google-calendar-help-dataapiRe: How to create RecurrenceException| From | Sent On | Attachments |
|---|---|---|
| herm...@gmail.com | 14 Dec 2007 08:43 | |
| Austin (Google) | 17 Dec 2007 10:09 |
| Subject: | Re: How to create RecurrenceException![]() |
|---|---|
| From: | Austin (Google) (api....@google.com) |
| Date: | 12/17/2007 10:09:54 AM |
| List: | com.googlegroups.google-calendar-help-dataapi |
Hi Herman,
You can create RecurrenceException by submitting request to the feed URI with the singleevents=true. This effectively roll out individual events of a series as single entries. Then you can take the edit URL of a single instance and send a PUT update request on that entry to create the event exception. The following is a sample code to demonstrate this with the PHP client library:
function createExceptionForRecurring() {
global $gdataCal;
$query = $gdataCal->newEventQuery(); $query->setSingleEvents(true); $query->setOrderby('starttime'); $query->setSortOrder('a'); $calID = 'default'; $query->setUser($calID); $query->setVisibility('private'); $query->setProjection('full');
$eventFeed = $gdataCal->getCalendarEventFeed($query);
foreach ($eventFeed as $event) {
$id = $event->id->text; $editLink = $event->getEditLink()->href;
$title = 'Exception to Recurring Series'; $where = 'here'; $content = 'content ...'; $event->title = $gdataCal->newTitle($title);
$startDate = date('Y-m-d', strtotime('today')); $endDate = date('Y-m-d', strtotime('today')); $startTime = '10:00'; $endTime = '11:00'; $tzOffset = '-08'; $when = $gdataCal->newWhen(); $when->startTime = "{$startDate}T{$startTime}:00.000{$tzOffset}:00"; $when->endTime = "{$endDate}T{$endTime}:00.000{$tzOffset}:00";
$event->when = array($when);
$event->save(); break; }
}
Hope it helps, Austin
On Dec 14, 2007 8:44 AM, herm...@gmail.com <herm...@gmail.com> wrote:
Hi:
I am new to this Google Calendar API, is there any code sample regarding an creation to a RecurrenceException for a Recurrence?
Thanks, Herman




