vendredi 7 mars 2014

Google Calendar API not filtering events correctly


Vote count:

0




For some reason I am running into an issue of Google Calendars API not filtering the results according to the params sent in the request. Here's my code :



if ($apiClient->getAccessToken()) {
$params['timeMin'] = date("c",strtotime($appointment_date."-30 minutes"));
$params['timeMax'] = date("c",strtotime($appointment_date."+150 minutes"));
$params['singleEvents'] = true;

try {
$calList = $cal->events->listEvents(trim($rep->calendar), $params);
} catch (Exception $e) {
var_dump($e->getMessage());
}

var_dump($params);
$event = $calList->items[0];
die(var_dump($calList));
}


Now, I repeated the same request via the Google API console available online, and the results are the same : I get a full day event that starts the day after :



{
"kind": "calendar#events",
"etag": "\"-kteSF26GsdKQ5bfmcd4H3_-u3g/X7YngPBdNdtQg5qQpuSYsr4PMo4\"",
"summary": "calendar@gmail.com",
"updated": "2014-03-07T19:01:33.781Z",
"timeZone": "America/Montreal",
"items": [
{

"kind": "calendar#event",
"etag": "\"-kteSF26GsdKQ5bfmcd4H3_-u3g/MTM5NDIxNjUwNzMwNzAwMA\"",
"id": "asdfasdfasdfasdfasdf",
"status": "confirmed",
"htmlLink": "http://ift.tt/1chlHEY",
"created": "2014-03-07T18:21:47.000Z",
"updated": "2014-03-07T18:21:47.307Z",
"summary": "Non Disponible",
"organizer": {
"self": true
},
"start": {
"date": "2014-03-14"
},
"end": {
"date": "2014-03-15"
},
"transparency": "transparent",
"iCalUID": "ft0mg8nuhmah8vam0st81et9dk@google.com",
"sequence": 0,
"reminders": {
"useDefault": false
}
}


When I check the calendar's timezone, it's set to 'America/Montreal' (correct)... So I just don't get why this is returning this event...


Any ideas ?



asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire