Here's is my code
if($service instanceof Google_Service_Calendar and isset($_SESSION['service_token']) and $_SESSION['service_token'] != '' ) {
$event = new Google_Service_Calendar_Event();
$event->setSummary('AllDay Event Bug');
$start = new Google_Service_Calendar_EventDateTime();
$start->setDateTime(date('Y-m-d\TH:i:s',strtotime('2015-11-11 10:00:00')));
$start->setTimeZone('Australia/Melbourne');
$event->setStart($start);
$end = new Google_Service_Calendar_EventDateTime();
$end->setDateTime(date('Y-m-d\TH:i:s',strtotime('2015-11-16 11:00:00')));
$end->setTimeZone('Australia/Melbourne');
$event->setEnd($end);
if(recurring) {
$recurrenceUntil = date('Ymd\THis\Z',strtotime('2015-11-16 11:00:00'));
if(count($exDateArr) > 0) {
$exdate = "EXDATE:".implode(",", $exDateArr);
} else {
$exdate = '';
}
switch ($repeate) {
case "day":
$frequence = "DAILY";
break;
case "week":
$frequence = "WEEKLY";
break;
case "month":
$frequence = "MONTHLY";
break;
case "year":
$frequence = "YEARLY";
break;
}
$event->setRecurrence(
array(
"RRULE:FREQ=".$frequence.";UNTIL=".$recurrenceUntil.";INTERVAL=".$repeate_interval,
$exdate
)
);
}
$newEvent = $service->events->insert('primary', $event);
}
When i search for that event in Google Calendar, this is the result i get.
Wed Nov 11, 2015 10:00am – 11:00am AllDay Event Bug
Thu Nov 12, 2015 All day AllDay Event Bug
10:00am – 11:00am AllDay Event Bug
Fri Nov 13, 2015 All day AllDay Event Bug
All day AllDay Event Bug
10:00am – 11:00am AllDay Event Bug
Sat Nov 14, 2015 All day AllDay Event Bug
All day AllDay Event Bug
All day AllDay Event Bug
10:00am – 11:00am AllDay Event Bug
Sun Nov 15, 2015 All day AllDay Event Bug
All day AllDay Event Bug
All day AllDay Event Bug
All day AllDay Event Bug
10:00am – 11:00am AllDay Event Bug
Mon Nov 16, 2015 All day AllDay Event Bug
All day AllDay Event Bug
All day AllDay Event Bug
All day AllDay Event Bug
All day AllDay Event Bug
10:00am – 11:00am AllDay Event Bug
Everything is good on the first day , next day onwards an extra "All day" event is added, and it increments every day.Can anyone please tell me why this is happening ? I'm using Google Service Account Credentials and the event i've added is not a recurring one and there are no exception dates.