Skip to content

Commit

Permalink
Update Google.php
Browse files Browse the repository at this point in the history
Fix: Exclude ctz Parameter for All-Day Events to Resolve Android Issue

This PR addresses an issue with the generate method in the Google calendar link generator, specifically for all-day events on Android devices. When the ctz (timezone) parameter is included for all-day events, Android devices encounter problems interpreting the event duration correctly, leading to inaccurate calendar entries.
  • Loading branch information
iYared authored Nov 14, 2024
1 parent 1178fda commit 1857e70
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Generators/Google.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,11 @@ public function generate(Link $link): string

$dateTimeFormat = $link->allDay ? self::DATE_FORMAT : self::DATETIME_FORMAT;
$url .= '&dates='.$link->from->format($dateTimeFormat).'/'.$link->to->format($dateTimeFormat);
$url .= '&ctz=' . $link->from->getTimezone()->getName();
$url .= '&text='.urlencode($link->title);

if (!$link->allDay) {
$url .= '&ctz=' . $link->from->getTimezone()->getName();
}

if ($link->description) {
$url .= '&details='.urlencode($link->description);
Expand Down

0 comments on commit 1857e70

Please sign in to comment.