Skip to content

algorithm-catalog: end date is optional (blank = ongoing event) - #252

Merged
kyle-lesinger merged 1 commit into
mainfrom
algorithm-catalog/optional-end-date
Oct 20, 2026
Merged

kyle-lesinger merged 1 commit into
mainfrom
algorithm-catalog/optional-end-date

Conversation

@kyle-lesinger

Copy link
Copy Markdown
Member

Follow-up to #250. This commit was pushed after #250 had already merged, so it never reached main.

What

A blank end date used to be a hard error ("End date is required.") in both rules.ts and validate_data.py. That blocked filing an event that's still underway. The Disasters Portal itself records only a startDate.

  • Rule: now only a malformed or out-of-order end date is an error. Two parity fixtures were added: an ongoing event passes, and a malformed end still fails.
  • Display: a missing end date reads as ongoing ("9 Oct 2026 – ongoing").
  • Date filter: ongoing events now match any later Events date filter. overlaps() used to treat "" as already ended, which silently hid them.
  • Request file: end is omitted rather than written as "".
  • Import: it no longer invents end = start, so Hurricane Isaias is now ongoing.
  • Form: the field reads "End date (optional)", with the hint "Leave blank while the event is ongoing".

Verified

  • validate_data.py and rules_parity_test.py pass, as do npm run typecheck and npm run build.
  • scripts/e2e.mjs passes 33/33 in Chromium. It includes three new checks:
    • an ongoing event renders as "– ongoing";
    • it still matches a later date filter;
    • Edit page opens with a blank end date and Open PR emits no end key.

A blank end date was a hard error in rules.ts and validate_data.py, which
blocked filing an event that is still underway; the Disasters Portal itself
records only a startDate. Now only a malformed or out-of-order end is an error.

- Missing end reads as ongoing ("9 Oct 2026 – ongoing") and still matches any
  later Events date filter (overlaps() treated "" as already ended).
- The request file omits end instead of writing ""; the import no longer
  invents end = start (Hurricane Isaias).
@kyle-lesinger
kyle-lesinger merged commit 9e349ac into main Oct 20, 2026
34 checks passed
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