mirror of
https://github.com/alextselegidis/easyappointments.git
synced 2024-11-25 17:33:19 +03:00
Add ability to sync all-day Google Calendar Events
This commit is contained in:
parent
2512159285
commit
edace7b002
1 changed files with 14 additions and 5 deletions
|
@ -184,7 +184,20 @@ class Google extends EA_Controller {
|
||||||
|
|
||||||
if ($google_event->getStart()->getDateTime() === $google_event->getEnd()->getDateTime())
|
if ($google_event->getStart()->getDateTime() === $google_event->getEnd()->getDateTime())
|
||||||
{
|
{
|
||||||
continue; // Skip all day events
|
$event_start = new DateTime($google_event->getStart()->getDate());
|
||||||
|
date_time_set($event_start, 0, 0);
|
||||||
|
$event_start->setTimezone($provider_timezone);
|
||||||
|
$event_end = new DateTime($google_event->getEnd()->getDate());
|
||||||
|
date_modify($event_end, '-1 day');
|
||||||
|
date_time_set($event_end, 23, 59);
|
||||||
|
$event_end->setTimezone($provider_timezone);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$event_start = new DateTime($google_event->getStart()->getDateTime());
|
||||||
|
$event_start->setTimezone($provider_timezone);
|
||||||
|
$event_end = new DateTime($google_event->getEnd()->getDateTime());
|
||||||
|
$event_end->setTimezone($provider_timezone);
|
||||||
}
|
}
|
||||||
|
|
||||||
$results = $CI->appointments_model->get_batch(['id_google_calendar' => $google_event->getId()]);
|
$results = $CI->appointments_model->get_batch(['id_google_calendar' => $google_event->getId()]);
|
||||||
|
@ -194,10 +207,6 @@ class Google extends EA_Controller {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$event_start = new DateTime($google_event->getStart()->getDateTime());
|
|
||||||
$event_start->setTimezone($provider_timezone);
|
|
||||||
$event_end = new DateTime($google_event->getEnd()->getDateTime());
|
|
||||||
$event_end->setTimezone($provider_timezone);
|
|
||||||
|
|
||||||
// Record doesn't exist in the Easy!Appointments, so add the event now.
|
// Record doesn't exist in the Easy!Appointments, so add the event now.
|
||||||
$appointment = [
|
$appointment = [
|
||||||
|
|
Loading…
Reference in a new issue