ProSchedulerSign in

Timeline · CRUD

Prevent past event creation

{ end: new Date() } in invalid hatches and blocks every day before today.

Live demo

Click an empty day last week · Click one next week

Fullscreen
import { ProScheduler } from "@andreisaac/pro-scheduler"
import { studioAssignments, studioResources } from "./data/studio"
import { useEvents } from "./kit"

export function TimelinePastDemo() {
  const { events, handlers } = useEvents(studioAssignments)

  return (
    <ProScheduler
      data={events}
      resources={studioResources}
      view={{ timeline: { type: "month" } }}
      invalid={[{ end: new Date(), title: "Past" }]}
      clickToCreate
      height={520}
      {...handlers}
    />
  )
}

About this demo

{ end: new Date() } in invalid hatches and blocks every day before today.

Things to try

  • Click an empty day last week
  • Click one next week

The props behind it are explained in Rules and backgrounds.

Use ProScheduler in your project