Skip to contentVibraUI
Dashboards

Clinic hours

The Clinic dashboard's hours: the first start, the time every visit is over by, the step a start falls on, and how far ahead the book is open.

Written once, where the Appointments page's reschedule dialog offers its days and slots from it and actions-clinic's rescheduleAppointment refuses by it, so the list can never offer a slot the server would refuse: retune the hours here and both follow. Plain constants with no directive and no imports, so a client island and a server action's module can both read them; times are "HH:mm" in UTC, as the clinic keeps them and as time-picker/time reads them.

Install

npx shadcn@latest add @vibra/hours-clinic

Needs the @vibra registry in your components.json — set it up once.

Props

PropTypeDefaultDescription
CLINIC_HOURS{ opens: "08:00"; closes: "18:00"; step: 15; horizonDays: 180 }—The first start of the day, the time every visit is over by, the minutes a start falls on from opening, and the days after today's the book is open to.

Dependencies

Registry

Source

lib/dashboards/clinic/hours.ts
/**
 * The clinic's hours, as the desk books them: the first visit at 08:00, every
 * visit over by 18:00 and started on a quarter hour, and the book open 180
 * days after today's. Written once, here: the reschedule dialog offers its days
 * and its slots from these, and the desk's actions refuse by them, so the list
 * can never offer a slot the server would refuse.
 *
 * Plain constants, with no directive and no imports, so a client island and a
 * server action's module can both read them. Times are "HH:mm" in UTC — the
 * clinic keeps UTC — as time-picker/time reads them.
 */
export const CLINIC_HOURS = {
  /** The first start of the day. */
  opens: "08:00",
  /** Every visit is over by then. */
  closes: "18:00",
  /** The minutes a start falls on: 08:00, 08:15, 08:30… */
  step: 15,
  /** How far ahead the book is open, in days after today's. */
  horizonDays: 180,
} as const