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:
- Go to an event with registration and time slot field
- Add new time slot fields (or edit existing ones)
- Enter invalid end date for time slot and try other invalid entries.
- Save
- 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.
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 atTimeSlotFieldEditor.tsx:106where.toISOString()is called on an invalid Dayjs object.To Reproduce
Steps to reproduce the behavior:
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
DateTimePickerenforces aminDateTimeconstraint (set to the start date) via its character-editing pipeline (applyCharacterEditing→updateSectionValue→publishValue). When the user enters a value that violates this constraint, MUI firesonChangewith an invalid Dayjs object — notnull, but an object whereisValid()returnsfalse.