ProSchedulerSign in

Timeline · Use cases

Transport management

Today's delivery routes per vehicle, at hour resolution, with plate and capacity in the resource column.

Live demo

Move a route to another van · Shorten a route by 15 minutes

Fullscreen
import { ProScheduler } from "@andreisaac/pro-scheduler"
import { deliveries, fleet } from "./data/operations"
import { useEvents } from "./kit"

const hhmm = (d: Date) => d.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" })

export function TransportDemo() {
  const { events, handlers } = useEvents(deliveries)

  return (
    <ProScheduler
      data={events}
      resources={fleet}
      view={{ timeline: { type: "day", dragTimeStep: 15 } }}
      styleConfig={{ unitWidthPx: 64, laneHeight: 38, resourceColWidth: 200 }}
      renderResource={(vehicle) => (
        <div className="min-w-0">
          <div className="truncate text-sm font-medium">{vehicle.name}</div>
          <div className="truncate text-xs text-muted-foreground">
            {String(vehicle.plate)} · {String(vehicle.capacity)}
          </div>
        </div>
      )}
      renderEventContent={({ original, start, end }) => (
        <div className="grid min-w-0 text-[11px] leading-tight">
          <strong className="truncate">{original.title}</strong>
          <span className="truncate opacity-85">
            {hhmm(start)}–{hhmm(end)}
          </span>
        </div>
      )}
      height={440}
      {...handlers}
    />
  )
}

About this demo

Today's delivery routes per vehicle, at hour resolution, with plate and capacity in the resource column.

Things to try

  • Move a route to another van
  • Shorten a route by 15 minutes

The props behind it are explained in Resources.

Use ProScheduler in your project