mantinedev/mantine · error · Error

[@mantine/schedule] Invalid start date for event id: ${event

Error message

[@mantine/schedule] Invalid start date for event id: ${eventData.id}

What it means

validateEvent checks every event before it is rendered by any Schedule view (agenda, month, mobile month, week, year). dayjs(event.start).isValid() returns false for unparseable dates, so the event's start cannot be resolved to a real date. The library throws rather than silently dropping or misplacing the event.

Source

Thrown at packages/@mantine/schedule/src/utils/validate-event/validate-event.ts:6

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

  1. Log the failing event by its id and inspect its start value
  2. Normalise dates at the API boundary (e.g. new Date(x) guarded by !Number.isNaN(x.getTime()) or dayjs(x).isValid())
  3. Default or filter out events with missing dates before passing events to the schedule

Example fix

// before
events = apiEvents; // start may be undefined

// after
const safeEvents = apiEvents.filter((e) => dayjs(e.start).isValid());
Defensive patterns

Strategy: validation

Validate before calling

import dayjs from 'dayjs';

const safeEvents = events.filter((e) => dayjs(e.start).isValid());

Type guard

const hasValidStart = (e: ScheduleEventData): boolean => dayjs(e.start).isValid();

Prevention

When it happens

Trigger: event.start is undefined, null, empty string, a non-date string like 'foo', or an invalid Date (new Date('oops')). Happens in every view because all views run validateEvent.

Common situations: Backend returning ISO strings with an unexpected format, forgetting to map API fields (using start instead of startDateTime), form submitting before a date was picked, timezone/serialisation stripping the field.

Related errors


AI-assisted analysis of mantinedev/mantine@8a284e2c2c (2026-08-28). Data as JSON: /api/errors/19655e10d417123f. Report an issue: GitHub.