mantinedev/mantine · error · Error
[@mantine/schedule] Invalid end date for event id: ${eventDa
Error message
[@mantine/schedule] Invalid end date for event id: ${eventData.id} What it means
validateEvent reports that event.end cannot be parsed as a valid date (dayjs(event.end).isValid() === false). Every schedule view validates this before layout. Without a valid end the duration cannot be computed, so the library fails fast.
Source
Thrown at packages/@mantine/schedule/src/utils/validate-event/validate-event.ts:10
import dayjs from 'dayjs';
import { ScheduleEventData } from '../../types';
export function validateEvent(eventData: ScheduleEventData) {
if (!dayjs(eventData.start).isValid()) {
throw new Error(`[@mantine/schedule] Invalid start date for event id: ${eventData.id}`);
}
if (!dayjs(eventData.end).isValid()) {
throw new Error(`[@mantine/schedule] Invalid end date for event id: ${eventData.id}`);
}
if (dayjs(eventData.end).isBefore(dayjs(eventData.start))) {
throw new Error(
`[@mantine/schedule] Event end date is before start date for event id: ${eventData.id}`
);
}
return eventData;
}
View on GitHub (pinned to 8a284e2c2c)
Solutions
- Inspect the event with the reported id and fix its end value
- Set end equal to start for instantaneous events instead of leaving it empty
- Normalise/validate events once at the data boundary before rendering
Example fix
// before
{ id: '1', start: '2025-01-01', end: undefined }
// after
{ id: '1', start: '2025-01-01', end: '2025-01-01' } Defensive patterns
Strategy: validation
Validate before calling
const safeEvents = events.filter( (e) => dayjs(e.start).isValid() && dayjs(e.end).isValid() );
Type guard
const hasValidDates = (e: ScheduleEventData): boolean => dayjs(e.start).isValid() && dayjs(e.end).isValid();
Prevention
- Default end to start for zero-duration events
- Reject form submissions with missing dates
- Normalise nulls from the API instead of passing them through
When it happens
Trigger: event.end is undefined/null, an empty string, or an unparseable value like '2024-13-45' or 'N/A'. All-day events created without an explicit end are a frequent cause.
Common situations: API omitting end for zero-length events, form where the end-time picker was optional, serialisation turning null into a string 'null'.
Related errors
- [@mantine/schedule] Invalid start date for event id: ${event
- [@mantine/schedule] Event end date is before start date for
- [@mantine/schedule] WeekView: Duplicated event ids found: ${
- [@mantine/schedule] YearView: Duplicated event ids found: ${
- [@mantine/schedule] AgendaView: Duplicated event ids found:
AI-assisted analysis of mantinedev/mantine@8a284e2c2c (2026-08-28).
Data as JSON: /api/errors/303c31d841479d39.
Report an issue: GitHub.