From 1d6b19445ff16791f5c395fb6befbdaa73095bad Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 7 Feb 2025 18:44:04 +0200 Subject: [PATCH 1/2] Support UTC timezone --- src/Tribe/Ticket_Object.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Tribe/Ticket_Object.php b/src/Tribe/Ticket_Object.php index 349bfe73fe..104421a66f 100644 --- a/src/Tribe/Ticket_Object.php +++ b/src/Tribe/Ticket_Object.php @@ -438,9 +438,10 @@ class_exists( 'Tribe__Events__Timezones' ) && is_null( $this->event_timezone ) ) { try { - $this->event_timezone = new DateTimeZone( Tribe__Events__Timezones::get_event_timezone_string( $this->get_event_id() ) ); + $timezone_string = Tribe__Events__Timezones::get_event_timezone_string( $this->get_event_id() ); + $this->event_timezone = new DateTimeZone( $timezone_string ); } catch ( Exception $exception ) { - $this->event_timezone = null; + $this->event_timezone = 'UTC+0' === $timezone_string ? new DateTimeZone( 'UTC' ) : null; } } From 662fec81572888b9fc76d5af282af72b9d0ebed4 Mon Sep 17 00:00:00 2001 From: Dimitrios Pantazis Date: Fri, 7 Feb 2025 18:46:01 +0200 Subject: [PATCH 2/2] fix phpcs --- src/Tribe/Ticket_Object.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/Tribe/Ticket_Object.php b/src/Tribe/Ticket_Object.php index 104421a66f..48fb6b2f2a 100644 --- a/src/Tribe/Ticket_Object.php +++ b/src/Tribe/Ticket_Object.php @@ -439,6 +439,7 @@ class_exists( 'Tribe__Events__Timezones' ) ) { try { $timezone_string = Tribe__Events__Timezones::get_event_timezone_string( $this->get_event_id() ); + $this->event_timezone = new DateTimeZone( $timezone_string ); } catch ( Exception $exception ) { $this->event_timezone = 'UTC+0' === $timezone_string ? new DateTimeZone( 'UTC' ) : null;