Skip to content

Instantly share code, notes, and snippets.

@nickstewart95
Created December 21, 2016 16:38
Show Gist options
  • Save nickstewart95/2291101daafd91c64bc1ad5a9f56af9c to your computer and use it in GitHub Desktop.
Save nickstewart95/2291101daafd91c64bc1ad5a9f56af9c to your computer and use it in GitHub Desktop.
if (!$stop && $attendee['displayName'] == $person) {
$start_time = strtotime($event->getStart()->getDateTime());
$end_time = strtotime($event->getEnd()->getDateTime());
//see if current time is in between an event
if (($start_time < $current_time) and ($current_time < $end_time)) { $start_time = date('g:i', $start_time); $end_time = date('g:i', $end_time); $event_id = $event->id;
$event = $service->events->get($calendar, $event_id);
$summary = $event->getSummary();
$message = $person . ' is in ' . $summary . ' from ' . $start_time . ' until ' . $end_time;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment