WeeklyScheduleEditor

WeeklyScheduleEditor records when someone is available in their local wall-clock time. Choose it for an availability policy that stays expressed as HH:mm windows and local YYYY-MM-DD exceptions; convert to UTC only at the consumer boundary, where the applicable time zone is known.

Examples

A regular work week

Each enabled weekday has one or more local time ranges. Add another interval for a split day, or use the copy control to clone a day's ranges to selected weekdays.

–
–
–
–
–
Unavailable
Unavailable

Override a specific date

Exceptions override their weekday. An empty ranges array makes that entire local date unavailable; a non-empty array replaces the normal weekday windows for that date.

–
Unavailable
Unavailable
Unavailable
Unavailable
Unavailable
Unavailable
Exceptions
Dec 25, 2026Unavailable all day
Dec 31, 202610:00–13:00

When to use

Use WeeklyScheduleEditor to define a person's ordinary weekly local-time availability with occasional date overrides.

Reach for something else when:

  • One event repeats on a schedule — use RecurrenceSelector, which describes a single recurring series.
  • People are choosing a bookable UTC slot — use SlotPicker, which converts those instants for display.
  • The application needs to visualize concrete events — use CalendarView.

Accessibility

  • Every weekday switch has its weekday as its label. Enabled ranges expose labelled start and end TimeInput controls, and an invalid end time is marked invalid with an inline explanation.
  • The copy action opens Popover as a labelled dialog. Its checkboxes are reachable by keyboard and Apply is disabled until a destination is selected.
  • The exception picker cannot add a date before today. Its add and remove controls, along with all weekday and range strings, come from labels.

API and code

NameTypeRequiredDescription
valueWeeklySchedule—Controlled weekly local-time availability.
defaultValueWeeklySchedule—Initial weekly local-time availability in uncontrolled mode.
onChange(value: WeeklySchedule) => void—Called after a weekday availability change.
exceptionsDateException[]—Controlled date exceptions.
onExceptionsChange(exceptions: DateException[]) => void—Called after date exceptions change.
defaultRangeTimeRange—Range created when enabling a weekday. Default: 09:00–17:00.
weekStartsOn0 | 1 | 2 | 3 | 4 | 5 | 6—First displayed weekday, where 0 is Sunday. Default: 1.
showExceptionsboolean—Whether to render date exceptions. Default: true.
labelsWeeklyScheduleEditorLabels—Translatable visible and accessible labels, merged over English defaults.

x-data="lyraWeeklyScheduleEditor({ … })"

OptionTypeRequiredDescription
valuePartial<WeeklySchedule>—Weekly local-time availability, merged over the empty seven-day schedule.
exceptionsDateException[]—Date-specific availability overrides.
defaultRangeTimeRange—Range created when enabling a weekday. Default: 09:00–17:00.
weekStartsOnWeekday—First displayed weekday, where 0 is Sunday. Default: 1.
showExceptionsboolean—Whether to render date exceptions. Default: true.
labelsWeeklyScheduleEditorLabels—Translatable labels merged over English defaults.

Without React, own range validation, copying and the exception override rules yourself:

html
<div class="lyra-sched">
  <div class="lyra-sched__row">
    <div class="lyra-sched__daycell">
      <label>Monday <input type="checkbox" checked /></label>
    </div>
    <div class="lyra-sched__ranges">
      <div class="lyra-sched__range">
        <input class="lyra-input" value="09:00" /><span class="lyra-sched__dash">–</span
        ><input class="lyra-input" value="17:00" />
      </div>
      <button class="lyra-sched__addrange" type="button">+ Add interval</button>
    </div>
  </div>
</div>

<lyra:weekly-schedule-editor> Generated from lyra-ds/blade v0.10.0.

The behavior comes from lyraWeeklyScheduleEditor() — install @lyra-ds/alpine and see the HTML + Alpine tab.

PropDefaultRequiredExample values
valuenull——
exceptions[]——
defaultRangenull——
weekStartsOn1——
showExceptionstrue——
labels[]——
namenull——
blade
<lyra:weekly-schedule-editor
    name="availability"
    :week-starts-on="1"
    :value="[
        1 => [['start' => '09:00', 'end' => '12:00'], ['start' => '13:00', 'end' => '18:00']],
        2 => [['start' => '09:00', 'end' => '18:00']],
        3 => [['start' => '09:00', 'end' => '18:00']],
    ]"
    :default-range="['start' => '09:00', 'end' => '17:00']"
/>