Skip to content

Commit

Permalink
Added timezone to ical dates
Browse files Browse the repository at this point in the history
  • Loading branch information
geoff-maddock committed Dec 23, 2024
1 parent 2f619d4 commit df3c83a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/Services/Calendar/ICalBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ public function buildCalendar(string $calendarName, $events): string
$vEvent = new iCalEvent($uniqueIdentifier);

// set up occurrence
$start = new DateTime($event->start_at, false);
$end = $event->end_at ? new DateTime($event->end_at, false) : null;
$start = new DateTime($event->start_at, true);
$end = $event->end_at ? new DateTime($event->end_at, true) : null;
$occurrence = new TimeSpan($start, $end ? $end : $start);

// update oldest and latest times
Expand All @@ -72,7 +72,7 @@ public function buildCalendar(string $calendarName, $events): string
->setDescription($event->description);

// convert $event->updated_at to timestamp
$updated = new DateTime($event->updated_at, false);
$updated = new DateTime($event->updated_at, true);
$vEvent->touch($updated);

// set the url
Expand Down

0 comments on commit df3c83a

Please sign in to comment.