ProSchedulerSign in

Scheduler · Configuring the view

Date limits

min and max keep the scheduler to this month and next: the arrows stop at the edges, and the time outside is hatched and can't be booked.

Live demo

Page forward until the arrow turns off · Try to drag a session past the last day

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

export function DateLimitsDemo() {
  const { events, handlers } = useEvents(() => studioSessions())
  // This month and next, nothing outside.
  const [min, max] = useMemo(() => {
    const now = new Date()
    return [new Date(now.getFullYear(), now.getMonth(), 1), new Date(now.getFullYear(), now.getMonth() + 2, 0)]
  }, [])
  return (
    <ProScheduler
      data={events}
      resources={studioResources}
      min={min}
      max={max}
      view={{ scheduler: { type: "week", startTime: "08:00", endTime: "19:00" } }}
      height={560}
      {...handlers}
    />
  )
}

About this demo

min and max keep the scheduler to this month and next: the arrows stop at the edges, and the time outside is hatched and can't be booked.

Things to try

  • Page forward until the arrow turns off
  • Try to drag a session past the last day

The props behind it are explained in Output and scale.

Use ProScheduler in your project