From 2299fae9f0e895b5440e02b32c182bdbe8868654 Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Wed, 10 May 2023 11:35:54 +0200 Subject: [PATCH 1/2] Include timezone name in serialized datetime format --- src/Contract/Frequency.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Contract/Frequency.php b/src/Contract/Frequency.php index be66bd6..2235787 100644 --- a/src/Contract/Frequency.php +++ b/src/Contract/Frequency.php @@ -8,7 +8,7 @@ interface Frequency extends JsonSerializable { /** @var string Format for representing datetimes when serializing the frequency to JSON */ - public const SERIALIZED_DATETIME_FORMAT = 'Y-m-d\TH:i:s.uP'; + public const SERIALIZED_DATETIME_FORMAT = 'Y-m-d\TH:i:s.ue'; /** * Get whether the frequency is due at the specified time From 2f2ab24135d3bd1b5cdd4e26337088addf34a66c Mon Sep 17 00:00:00 2001 From: Yonas Habteab Date: Fri, 12 May 2023 15:00:54 +0200 Subject: [PATCH 2/2] Don't reset start date to `UTC` --- src/RRule.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/RRule.php b/src/RRule.php index c5eb35d..d71e754 100644 --- a/src/RRule.php +++ b/src/RRule.php @@ -286,9 +286,7 @@ public function jsonSerialize(): array $start = $this->getStart(); if ($start) { - $data['start'] = (clone $start) - ->setTimezone(new DateTimeZone('UTC')) - ->format(static::SERIALIZED_DATETIME_FORMAT); + $data['start'] = $start->format(static::SERIALIZED_DATETIME_FORMAT); } return $data;