Show only upcoming activities on the online activities page - #3666
Merged
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The page listed activities with start dates from 2020, 2021 and 2022.
OnlineCalendar::baseQuery()gated the list onend_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:
Change
baseQuery()now filters onstart_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.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_startedcovers 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_comeguards the month dropdown against past months reappearing.All 16 tests in
OnlineEventsWorkflowTestpass.Made with Cursor