ScheduleExceptions
One person's days off and changed hours: a list of what's ahead, and a form to add a day off or different hours for a day or a range, with as many breaks as the day needs (working 8–10, 11–14, then 15–18). An exception replaces that day's usual hours and gaps. On the Team page today, and the card the owner's chat will show.
Playground
- 10:00–12:00, 14:00–18:00Different hoursFri, Nov 13“Long lunch”
- Day offMon, Nov 30 – Mon, Dec 7 · 8 days“Holiday”
import {
ExceptionForm,
ExceptionList,
} from "@/components/shared/schedule-exceptions";
<ExceptionList
exceptions={exceptions}
locale="en"
onRemove={(e) => removeException(e.id)}
/>
<ExceptionForm
today={today}
locale="en"
onSubmit={(input) => addException(staffId, input)}
/>Nothing ahead
No days off or changed hours ahead.
<ExceptionList exceptions={[]} locale="en" onRemove={remove} />ExceptionList API
| Prop | Type | Default | Description |
|---|---|---|---|
| exceptions | ScheduleException[] | — | The person's exceptions that haven't ended, soonest first (listExceptions). |
| locale | string | — | Formats the dates: “Mon, Oct 12”, “po 12. 10.”. |
| onRemove | (exception: ScheduleException) => void | — | Called by a row's ×. Offer Undo: removal lands at once. |
| labels | Partial<ScheduleExceptionsLabels> | English | Every word, including remove(dates). |
ExceptionForm API
| Prop | Type | Default | Description |
|---|---|---|---|
| today | string | — | The studio's today, YYYY-MM-DD. Earlier days can't be picked; later ones have no limit. |
| locale | string | — | The calendar's month and weekday names. |
| onSubmit | (input) => Promise<ExceptionFormError | null> | — | Saves the exception. Resolve to null when saved, or to overlaps, inPast or failed to show why not. |
| onCancel | () => void | — | Shows a Cancel button beside Save. |
| labels | Partial<ScheduleExceptionsLabels> | English | Every word, including each error. |
Guidelines
- One answer per person per date: an exception can't overlap another one for the same person. Remove the old one first.
- A changed day lists as the stretches worked, gaps left out: “10:00–12:00, 14:00–18:00”. Breaks sit inside the day, in order, without overlapping.
- Pick one day by tapping it once; a range by tapping its first and last day.
- Bookings already inside a new day off stay booked for now. The owner's chat will list them and offer what to do (spec C8).