Skip to content

Bug: Event registration time slot field option not validated properly #2228

Description

@HaraldWalker

Describe the bug
When a user edits a time slot's end date on the event registration form and selects/enters a date that is before the start date, the application crashes with RangeError: Invalid Date. The error originates at TimeSlotFieldEditor.tsx:106 where .toISOString() is called on an invalid Dayjs object.

To Reproduce
Steps to reproduce the behavior:

  1. Go to an event with registration and time slot field
  2. Add new time slot fields (or edit existing ones)
  3. Enter invalid end date for time slot and try other invalid entries.
  4. Save
  5. See error

Expected behavior
System validates form and gives proper user feedback. Does not submit the form until the data is valid.

Additional context
Root cause:
MUI's DateTimePicker enforces a minDateTime constraint (set to the start date) via its character-editing pipeline (applyCharacterEditing → updateSectionValue → publishValue). When the user enters a value that violates this constraint, MUI fires onChange with an invalid Dayjs object — not null, but an object where isValid() returns false.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions