Skip to content

Ensure the Nearest Upcoming Event Is Displayed First#1021

Merged
andrea-kyurchiev merged 1 commit intomasterfrom
fix-call-algo
May 8, 2025
Merged

Ensure the Nearest Upcoming Event Is Displayed First#1021
andrea-kyurchiev merged 1 commit intomasterfrom
fix-call-algo

Conversation

@yuhattor
Copy link
Copy Markdown
Member

@yuhattor yuhattor commented May 8, 2025

Overview

Previously, the logic for displaying upcoming events could result in the most distant future event being shown. This PR fixes that behavior by ensuring the nearest upcoming event is always displayed.

Changes

  • Modified the logic to use $futureEvents.ByDate to sort upcoming events in ascending order by date
  • Now displays the first event in the list (i.e., the soonest upcoming event)

Affected files:

  • layouts/shortcodes/upcoming-event-card.html
  • layouts/partials/header.html

How to Test

  1. Create multiple upcoming events in the content directory (e.g., an existing event on 2025-05-06 and others with later dates)
  2. Serve the website locally
  3. Verify that the event with the nearest future date is the one displayed

@yuhattor yuhattor requested a review from a team as a code owner May 8, 2025 10:54
@yuhattor yuhattor requested a review from andrea-kyurchiev May 8, 2025 10:55
@andrea-kyurchiev andrea-kyurchiev merged commit 87d863d into master May 8, 2025
1 check passed
@andrea-kyurchiev andrea-kyurchiev deleted the fix-call-algo branch May 8, 2025 11:44
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