From a635c159d465f3b1248c468baf0e5e3335cd335f Mon Sep 17 00:00:00 2001 From: Khokan Sardar Date: Fri, 5 Jun 2026 09:18:09 +0530 Subject: [PATCH 1/2] Translation Events: Hide end date when more than 1 year in the future On the event details page, stop displaying the end date and its relative time (e.g. "Ends: in 9 years") when the end date is more than one year away. Past end dates and near-future ones are unaffected. Fixes https://meta.trac.wordpress.org/ticket/8280 --- .../wporg-gp-translation-events/includes/event/event-date.php | 4 ++++ .../wporg-gp-translation-events/templates/event-details.php | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event-date.php b/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event-date.php index f5d2055032..587f8bfc77 100644 --- a/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event-date.php +++ b/wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event-date.php @@ -62,6 +62,10 @@ public function is_in_the_past() { return $this->utc() < Translation_Events::now(); } + public function is_more_than_one_year_in_the_future(): bool { + return $this->utc() > Translation_Events::now()->modify( '+1 year' ); + } + public function print_relative_time_html() { echo wp_kses( '