Dear All,

I am trying to create a new event in a secondary calendar (non-default
calendar), but I couldn't.

Should I use the setUser=<calendarID>@group.calendar.google.com? The
code that I am using is below, but it is working only for the default
calendar.

Thanks in advance,

Gines

function processPageLoad()
{
        $client = getClientLoginHttpClient(email,password);
               createEvent($client, $title = 'Teste PHP2',
$desc='Descrição', $where = 'onde', $startDate = '2008-08-30',
$startTime = '20:00', $endDate = '2008-08-30', $endTime = '22:00');
}


function createEvent ($client, $title, $desc, $where, $startDate,
$startTime, $endDate, $endTime)
{
  $gc = new Zend_Gdata_Calendar($client);
  $newEntry = $gc->newEventEntry();
  $newEntry->title = $gc->newTitle(trim($title));
  $newEntry->where  = array($gc->newWhere($where));

  $newEntry->content = $gc->newContent($desc);
  $newEntry->content->type = 'text';

  $when = $gc->newWhen();
  $when->startTime = "{$startDate}T{$startTime}:00.000";
  $when->endTime = "{$endDate}T{$endTime}:00.000";
  $newEntry->when = array($when);

  $createdEntry = $gc->insertEvent($newEntry);
        echo "<pre>";
  print_r($newEntry);
        echo "<\pre>";

  return $createdEntry->id->text;
}

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Calendar Data API" group.
To post to this group, send email to 
[email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/google-calendar-help-dataapi?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to