Merge pull request #967 from bevanjkay/all-day-google-events

All day google events
This commit is contained in:
Alex Tselegidis 2021-04-07 09:49:35 +02:00 committed by GitHub
commit 718fbf97aa
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 15 deletions

View file

@ -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 = [

14
package-lock.json generated
View file

@ -98,7 +98,7 @@
}, },
"ansi-colors": { "ansi-colors": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "http://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-1.1.0.tgz",
"integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==", "integrity": "sha512-SFKX67auSNoVR38N3L+nvsPjOE0bybKTYbkf5tRvushrAPQ9V75huw0ZxBkKVeRU9kqH3d6HA4xTckbwZ4ixmA==",
"dev": true, "dev": true,
"requires": { "requires": {
@ -5966,11 +5966,6 @@
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
"integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ=="
}, },
"ini": {
"version": "1.3.5",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz",
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw=="
},
"inquirer": { "inquirer": {
"version": "3.3.0", "version": "3.3.0",
"resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz", "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-3.3.0.tgz",
@ -11833,10 +11828,9 @@
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
}, },
"ini": { "ini": {
"version": "1.3.5", "version": "1.3.7",
"resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.7.tgz",
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "integrity": "sha512-iKpRpXP+CrP2jyrxvg1kMUpXDyRUFDWurxbnVT1vQPx+Wz9uCYsMIqYuSBLV+PAaZG/d7kRLKRFc9oDMsH+mFQ=="
"dev": true
}, },
"inquirer": { "inquirer": {
"version": "0.12.0", "version": "0.12.0",