rpiambulance / website

RPI Ambulance's website—a work in progress
http://rpiambulance.com/
3 stars 14 forks source link

Events cannot be multi-day or end at 2400 hrs #171

Open ddbruce opened 5 months ago

ddbruce commented 5 months ago

When creating an event, it cannot end at 2400 hrs, and events cannot be created that span over midnight. When making an event that starts, say, at 1700 hrs and ends at 0000, the event gets added to the database:

image

but does not get added to gcal:

[Sun Feb 04 20:58:07.173069 2024] [php7:error] [pid 12374] [client 172.18.0.2:51226] PHP Fatal error:  Uncaught Google_Service_Exception: {\n "error": {\n  "errors": [\n   {\n    "domain": "calendar",\n    "reason": "timeRangeEmpty",\n    "message": "The specified time range is empty.",\n    "locationType": "parameter",\n    "location": "timeMax"\n   }\n  ],\n  "code": 400,\n  "message": "The specified time range is empty."\n }\n}\n in /var/www/html/vendor/google/apiclient/src/Google/Http/REST.php:118\nStack trace:\n#0 /var/www/html/vendor/google/apiclient/src/Google/Http/REST.php(94): Google_Http_REST::decodeHttpResponse(Object(GuzzleHttp\\Psr7\\Response), Object(GuzzleHttp\\Psr7\\Request), 'Google_Service_...')\n#1 /var/www/html/vendor/google/apiclient/src/Google/Task/Runner.php(176): Google_Http_REST::doExecute(Object(GuzzleHttp\\Client), Object(GuzzleHttp\\Psr7\\Request), 'Google_Service_...')\n#2 /var/www/html/vendor/google/apiclient/src/Google/Http/REST.php(58): Google_Task_Runner->run()\n#3 /var/www/html/vendor/google/apiclient/src/Google/Client.php(830): Google_Http_REST::execute(Object(GuzzleHttp\\Client), Object(GuzzleHttp\\Psr7 in /var/www/html/vendor/google/apiclient/src/Google/Http/REST.php on line 118, referer: https://rpiambulance.com/

It is possible to have a start time after an end time, but the same gcal error occurs when creation.

Ideally this gets fixed by adding a column to the database for end_date and/or just changing start and end to datetimes rather than having date with a start and end time.

ddbruce commented 5 months ago

Here's the schema for reference:

image
ddbruce commented 5 months ago

hide seems to do nothing on the website