From 1857e70147e15f20546df965056aacea30b17108 Mon Sep 17 00:00:00 2001 From: Yared Ayalew Date: Thu, 14 Nov 2024 20:57:21 +0300 Subject: [PATCH] Update Google.php 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. --- src/Generators/Google.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Generators/Google.php b/src/Generators/Google.php index ec3eb71..5543ac2 100644 --- a/src/Generators/Google.php +++ b/src/Generators/Google.php @@ -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);