protected function setDateProperty(string $name, Carbon $date)
{
$eventDateTime = new Google_Service_Calendar_EventDateTime();
if (in_array($name, ['start.date', 'end.date'])) {
$eventDateTime->setDate($date->format('Y-m-d'));
$eventDateTime->setTimezone($date->getTimezone());
}
if (in_array($name, ['start.dateTime', 'end.dateTime'])) {
$eventDateTime->setDateTime($date->format(DateTime::RFC3339));
$eventDateTime->setTimezone($date->getTimezone());
}
if (starts_with($name, 'start')) {
$this->googleEvent->setStart($eventDateTime);
}
if (starts_with($name, 'end')) {
$this->googleEvent->setEnd($eventDateTime);
}
}