Skip to content

Translation Events: Hide end date when more than 1 year in the future#676

Open
itzmekhokan wants to merge 2 commits into
WordPress:trunkfrom
itzmekhokan:fix/8280-unrealistic-event-end-date
Open

Translation Events: Hide end date when more than 1 year in the future#676
itzmekhokan wants to merge 2 commits into
WordPress:trunkfrom
itzmekhokan:fix/8280-unrealistic-event-end-date

Conversation

@itzmekhokan

Copy link
Copy Markdown

On the event details page, the end date and relative time (e.g. "Ends: in 9 years") are now hidden when the end date is more than one year in the future. Past end dates and near-future ones are unaffected.

Fixes https://meta.trac.wordpress.org/ticket/8280

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
Copilot AI review requested due to automatic review settings June 5, 2026 03:50
@github-actions

github-actions Bot commented Jun 5, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

Core Committers: Use this line as a base for the props when committing in SVN:

Props khokansardar.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR adds logic to suppress displaying an event “End” timestamp when the event end date is more than one year in the future.

Changes:

  • Adds Event_Date::is_more_than_one_year_in_the_future() helper for date comparison.
  • Updates the event details template to conditionally render the “Ends/Ended” UI only when relevant.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/templates/event-details.php Conditionally hides the end date block when the end time is far in the future.
wordpress.org/public_html/wp-content/plugins/wporg-gp-translation-events/includes/event/event-date.php Introduces a helper method to detect end times more than one year ahead.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Extract Translation_Events::now() to a variable before calling modify()
  to make the immutability explicit and avoid any side-effect ambiguity.
- Store $event->end() in a local $end variable in the event details
  template to avoid repeated method calls within the conditional block.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants