Skip to content

fix(web): keep event's own date selectable in recurrence "Ends on" picker - #2550

Draft
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixrecurrence-stop-disabling-the-events-04ae07
Draft

fix(web): keep event's own date selectable in recurrence "Ends on" picker#2550
posthog[bot] wants to merge 1 commit into
mainfrom
posthog-self-driving/fixrecurrence-stop-disabling-the-events-04ae07

Conversation

@posthog

@posthog posthog Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Who's hurt: users setting up a recurring timed event that runs past local midnight can't pick the event's own date as the recurrence end — it renders disabled (aria-label="Not available …"), a silent dead end with no visible explanation.
  • Mechanism: RecurrenceSectionView derived the picker's minDate from the event's end. When an event ends at/after local midnight (e.g. 23:00–00:30, or anything ending 00:00 the next day), the end lands on the next calendar day. react-datepicker (v4.25.0) disables day cells by calendar day (differenceInCalendarDays), so the event's own start date — the date the user sees and reaches for — sorts before minDate and is disabled.
  • Fix: anchor minDate to the event's start date, normalized to a bare YYYY-MM-DD. The recurrence can't stop before its own first occurrence, so the start date is the correct floor. Selecting it still produces a valid recurrence that includes the first occurrence (verified against CompassEventRRule expansion).

Note

The inbox report proposed a different mechanism (a timed minDate keeping its time of day, disabling the same-day cell). That does not reproduce on the pinned react-datepicker@4.25.0: it compares by calendar day and ignores time-of-day, so a same-day event's date is already selectable. The real trigger is the end date landing on a later calendar day than the start — which matches the report's captured DOM exactly (Not available Monday, August 3rd, 2026, i.e. that user's event ended on Aug 4). The report's suggested date-only normalization would have been a no-op.

Simplicity

  • One-line change to how the floor is computed; the branch on event kind collapses since both kinds now use the same date-only start bound.

Automated validation

  • Reproduced the exact symptom in a test (past-midnight event → Not available Monday, August 3rd, 2026); confirmed it fails on the old end-based bound and passes after the fix.
  • Verified across timezones (UTC, America/New_York, Asia/Tokyo, …) that a normal same-day event was never disabled, and that a past-midnight event's start date flips from disabled → selectable.
  • Confirmed via CompassEventRRule.all(...) that selecting the start date as UNTIL still yields the first occurrence — no empty-recurrence side effect.

Independent review

Test plan

TZ=Etc/UTC bun test src/views/Forms/EventForm/DateControlsSection/RecurrenceSection/
  • 24 pass / 0 fail. biome check clean on the changed files; type-check clean.

Created with PostHog Desktop from this inbox report.

…cker

Anchor the recurrence "Ends on" picker's minimum date to the event's start
date instead of its end. The end-based floor disabled the event's own date
for any event running past local midnight (the end lands on the next calendar
day, and react-datepicker compares day cells by calendar day), leaving the
date the user most naturally picks unselectable.

Generated-By: PostHog Code
Task-Id: 2f1dc9cd-27d1-450a-9ca7-3fb74c208a29
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.

0 participants