> ## Documentation Index
> Fetch the complete documentation index at: https://docs.calgest.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Agenda working hours

# Agenda: shade hours outside the organization's working time

Status: not built. Recorded 2026-09-03 while polishing the agenda.

## What we want

The week and day grids show 00:00 to 24:00 with every hour looking the same.
A salon that opens at 09:00 and closes at 19:00 has no visual cue for where
the working day starts and ends, so an empty grid reads as "nothing here"
rather than "closed". Dimming the hours outside working time (a light hatch,
the same on both themes) makes the open hours the obvious place to drop an
appointment.

## Why it is not in yet

There is no organization-level opening-hours setting to read from.
`organizationSettings` only has `workScheduleEnabled`. The only time windows
in the data model are:

* per booking page: `bookingPages.availabilityGroups[].timeSlots` (weekly,
  date-range or specific-date groups with `startTime`/`endTime` per weekday);
* per employee: work schedules, gated by `workScheduleEnabled`.

Hardcoding 08:00 to 20:00 was tried and rejected: it would be wrong for any
tenant whose hours differ, and wrong data is worse than no shading.

## What is already there

The scheduler accepts an optional `businessHours` prop (`{ start, end }`,
hours 0-24) that the context passes to `TimeColumn` and `TimeGutter`. Passing
it dims the bands outside the window and softens the gutter labels. Nothing
passes it today.

Files: `apps/dashboard/src/components/ui/scheduler/types.ts`
(`BusinessHours`, `SchedulerProps.businessHours`),
`context/scheduler-context.tsx`, `components/time-grid.tsx`.

## How to build it

1. Add opening hours to `organizationSettings`, either a single
   `{ start: "HH:mm", end: "HH:mm" }` or a per-weekday array mirroring the
   booking-page `timeSlots` shape. Per weekday is the honest model (many
   salons close Mondays or work half days on Saturdays) and would let the
   grid shade each column differently; that needs `businessHours` to accept a
   per-day form.
2. Expose it in Settings, General, next to timezone and week start.
3. In `routes/_authenticated/index.tsx`, read it from the org settings query
   and pass `businessHours` to `<Scheduler>`.
4. Optional follow-ups once the setting exists: default the grid scroll
   position to the opening hour instead of "now" when today is not visible,
   and have quick-create outside hours ask for confirmation.

Until then the grid stays uniform.
