Skip to content

Show only upcoming activities on the online activities page - #3666

Merged
bernardhanna merged 1 commit into
masterfrom
fix/online-activities-upcoming-only
Sep 16, 2026
Merged

bernardhanna merged 1 commit into
masterfrom
fix/online-activities-upcoming-only

Conversation

@bernardhanna

Copy link
Copy Markdown
Collaborator

Problem

The page listed activities with start dates from 2020, 2021 and 2022.

OnlineCalendar::baseQuery() gated the list on end_date >= now() so that activities already under way stayed visible. A number of activities carry a start date years in the past together with an end date years in the future, and those sailed through that filter.

Counting the start dates currently rendered on https://codeweek.eu/online-activities:

Start year Count
2020 2
2021 1
2022 1
2025 6
2026 215

Change

baseQuery() now filters on start_date >= today, so only activities that have not started yet are listed. Activities starting later today still appear.

Two pieces of machinery existed purely to cope with past start dates and are removed:

  • effectiveStart(), which grouped an already-running activity under the current month rather than the month it actually started in.
  • The orWhere('start_date', '<', $monthStart) branch that pulled those activities into the current month filter.

Sorting now comes straight from the query's orderBy('start_date').

Effect on the live list

Of the 225 activities currently shown, 17 have already started and drop off, leaving 208. By start year: 2020 (2), 2021 (1), 2022 (1), 2025 (6), 2026 (7).

This reverses the behaviour added in #3659. Long-running activities that genuinely are still open will no longer be listed once they have begun.

Tests

  • online_activities_page_excludes_activities_that_already_started covers the reported case: an activity starting five years ago with an end date a year out must not appear, and neither must one that started earlier this month.
  • the_month_filter_only_offers_months_that_are_still_to_come guards the month dropdown against past months reappearing.
  • The two tests asserting the opposite behaviour are replaced.

All 16 tests in OnlineEventsWorkflowTest pass.

Made with Cursor

The list filtered on the end date, so activities starting in 2020, 2021
and 2022 that carry an end date years in the future stayed on the page.
Filter on the start date instead: 17 of the 225 listed activities had
already started, including four dated before 2025.

Grouping activities under the current month is no longer needed now that
nothing earlier than today can appear.

Co-authored-by: Cursor <cursoragent@cursor.com>
@bernardhanna
bernardhanna merged commit bb52428 into master Sep 16, 2026
1 check failed
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.

1 participant