Business hours editor

Edit the weekly business hours on a voice routing config: add and remove windows, toggle days, set open/close times, and save. Times are in the tenant's timezone (a tenant-level setting, shown as context).

Installation

npx shadcn@latest add @handset/business-hours-editor

Reads and writes through the proxy's new GET / PATCH /routing_configs/:id routes — re-add the proxy component if you installed it before this shipped.

Usage

import { BusinessHoursEditor } from "@/components/handset/business-hours-editor";

<BusinessHoursEditor routingConfigId={config.id} timezone={tenant.timezone} />

Built on useRoutingConfig. On save it PATCHes the whole config (business hours plus the existing open_behavior / closed_behavior) so the call never drops the routing that isn't about hours. An empty schedule means “open 24/7”.

Props

Props
PropTypeDefaultDescription
routingConfigIdstring—The routing config to edit (rtc_…).
timezonestring—The tenant's IANA timezone, shown as context.
onSaved() => void—Called after a successful save.
classNamestring—Merged onto the root card.