From 31cf8455a7e1a966aea9906667d9d383543a55b0 Mon Sep 17 00:00:00 2001 From: Jaymz Rhime Date: Thu, 2 Mar 2023 07:40:58 -0600 Subject: [PATCH 1/2] Add back the Z marker for UTC times --- src/Generators/Ics.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Generators/Ics.php b/src/Generators/Ics.php index b3fb43f..b738974 100644 --- a/src/Generators/Ics.php +++ b/src/Generators/Ics.php @@ -13,7 +13,7 @@ class Ics implements Generator /** @var string {@see https://www.php.net/manual/en/function.date.php} */ protected $dateFormat = 'Ymd'; /** @var string */ - protected $dateTimeFormat = 'Ymd\THis'; + protected $dateTimeFormat = 'Ymd\THis\Z'; /** @var array */ protected $options = []; From 47643c6c8c9da60dcb446b689c5767499b018b89 Mon Sep 17 00:00:00 2001 From: Jaymz Rhime Date: Thu, 2 Mar 2023 09:30:45 -0600 Subject: [PATCH 2/2] Update unit tests to add the Z to UTC timestamps --- ...cription_is_html_code_event_link_with_allday_flag__1.txt | 6 +++--- ...rTest__it_can_generate_a_multiple_days_event_link__1.txt | 6 +++--- ...GeneratorTest__it_can_generate_a_short_event_link__1.txt | 6 +++--- ...Test__it_can_generate_an_ics_link_with_custom_uid__1.txt | 6 +++--- .../IcsGeneratorTest__it_has_a_product_dtstamp__1.txt | 6 +++--- .../IcsGeneratorTest__it_has_a_product_id__1.txt | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_description_is_html_code_event_link_with_allday_flag__1.txt b/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_description_is_html_code_event_link_with_allday_flag__1.txt index b18c4a8..505d91b 100644 --- a/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_description_is_html_code_event_link_with_allday_flag__1.txt +++ b/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_description_is_html_code_event_link_with_allday_flag__1.txt @@ -4,9 +4,9 @@ PRODID:Spatie calendar-links BEGIN:VEVENT UID:9fc99e4f3dcee13f23355d63918b9a0c SUMMARY:Birthday Party +1 -DTSTAMP:20180201T090000 -DTSTART:20180201T090000 -DTEND:20180201T180000 +DTSTAMP:20180201T090000Z +DTSTART:20180201T090000Z +DTEND:20180201T180000Z DESCRIPTION:With balloons\, clowns and stuff\nBring a dog\, bring a frog.\nThere will be line breaks on it.\nProject link calendar-links\n\n\nThank you.\n LOCATION:Party Lane 1A\, 1337 Funtown END:VEVENT diff --git a/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_multiple_days_event_link__1.txt b/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_multiple_days_event_link__1.txt index e92486d..b0ad625 100644 --- a/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_multiple_days_event_link__1.txt +++ b/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_multiple_days_event_link__1.txt @@ -4,9 +4,9 @@ PRODID:Spatie calendar-links BEGIN:VEVENT UID:2009a227b7dd438a285434127f67f267 SUMMARY:New Year -DTSTAMP:20191231T230000 -DTSTART:20191231T230000 -DTEND:20200101T010000 +DTSTAMP:20191231T230000Z +DTSTART:20191231T230000Z +DTEND:20200101T010000Z DESCRIPTION:With balloons\, clowns and stuff\nBring a dog\, bring a frog LOCATION:Party Lane 1A\, 1337 Funtown END:VEVENT diff --git a/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_short_event_link__1.txt b/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_short_event_link__1.txt index e025fa8..e0bd621 100644 --- a/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_short_event_link__1.txt +++ b/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_a_short_event_link__1.txt @@ -4,9 +4,9 @@ PRODID:Spatie calendar-links BEGIN:VEVENT UID:94ab75add84a67c019eae57539658036 SUMMARY:Birthday -DTSTAMP:20180201T090000 -DTSTART:20180201T090000 -DTEND:20180201T180000 +DTSTAMP:20180201T090000Z +DTSTART:20180201T090000Z +DTEND:20180201T180000Z DESCRIPTION:With balloons\, clowns and stuff\nBring a dog\, bring a frog LOCATION:Party Lane 1A\, 1337 Funtown END:VEVENT diff --git a/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_an_ics_link_with_custom_uid__1.txt b/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_an_ics_link_with_custom_uid__1.txt index 59d1cc3..a451c8e 100644 --- a/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_an_ics_link_with_custom_uid__1.txt +++ b/tests/Generators/__snapshots__/IcsGeneratorTest__it_can_generate_an_ics_link_with_custom_uid__1.txt @@ -4,9 +4,9 @@ PRODID:Spatie calendar-links BEGIN:VEVENT UID:random-uid SUMMARY:Birthday -DTSTAMP:20180201T090000 -DTSTART:20180201T090000 -DTEND:20180201T180000 +DTSTAMP:20180201T090000Z +DTSTART:20180201T090000Z +DTEND:20180201T180000Z DESCRIPTION:With balloons\, clowns and stuff\nBring a dog\, bring a frog LOCATION:Party Lane 1A\, 1337 Funtown END:VEVENT diff --git a/tests/Generators/__snapshots__/IcsGeneratorTest__it_has_a_product_dtstamp__1.txt b/tests/Generators/__snapshots__/IcsGeneratorTest__it_has_a_product_dtstamp__1.txt index e025fa8..e0bd621 100644 --- a/tests/Generators/__snapshots__/IcsGeneratorTest__it_has_a_product_dtstamp__1.txt +++ b/tests/Generators/__snapshots__/IcsGeneratorTest__it_has_a_product_dtstamp__1.txt @@ -4,9 +4,9 @@ PRODID:Spatie calendar-links BEGIN:VEVENT UID:94ab75add84a67c019eae57539658036 SUMMARY:Birthday -DTSTAMP:20180201T090000 -DTSTART:20180201T090000 -DTEND:20180201T180000 +DTSTAMP:20180201T090000Z +DTSTART:20180201T090000Z +DTEND:20180201T180000Z DESCRIPTION:With balloons\, clowns and stuff\nBring a dog\, bring a frog LOCATION:Party Lane 1A\, 1337 Funtown END:VEVENT diff --git a/tests/Generators/__snapshots__/IcsGeneratorTest__it_has_a_product_id__1.txt b/tests/Generators/__snapshots__/IcsGeneratorTest__it_has_a_product_id__1.txt index e025fa8..e0bd621 100644 --- a/tests/Generators/__snapshots__/IcsGeneratorTest__it_has_a_product_id__1.txt +++ b/tests/Generators/__snapshots__/IcsGeneratorTest__it_has_a_product_id__1.txt @@ -4,9 +4,9 @@ PRODID:Spatie calendar-links BEGIN:VEVENT UID:94ab75add84a67c019eae57539658036 SUMMARY:Birthday -DTSTAMP:20180201T090000 -DTSTART:20180201T090000 -DTEND:20180201T180000 +DTSTAMP:20180201T090000Z +DTSTART:20180201T090000Z +DTEND:20180201T180000Z DESCRIPTION:With balloons\, clowns and stuff\nBring a dog\, bring a frog LOCATION:Party Lane 1A\, 1337 Funtown END:VEVENT