Agenda

What's coming, grouped by day: times, places, repeats and stays over several days.

  1. Tuesday, December 8

  2. Wednesday, December 9

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/agenda

Usage

import { Agenda } from "./ui/uicontext/components/schedule/Agenda.ts"import type { Occurrence } from "./ui/uicontext/components/schedule/Events.ts"
const Message = UiSchema.TaggedEnum({ OpenedEvent: { occurrence: Schema.String } })// the next two weeks; days with nothing are left outexport const Upcoming = (h: Html.H<typeof Message.Type>, occurrences: ReadonlyArray<Occurrence>, today: string, now: string) =>	Agenda(h, { occurrences, from: today, days: 14, timeZone: "America/New_York", now, onOpen: (occurrence) => Message.OpenedEvent({ occurrence }) })

API reference

Options

Agenda options
NameTypeDescription
occurrencesrequiredOccurrence[]—
fromrequiredIsoDateThe first day listed, and how many
daysrequirednumber—
timeZonerequiredstringThe zone days and times read in
nowrequiredstringThe app's current instant (ISO)
localestring—
hour12boolean—
onOpenrequired(occurrence: string) => Message—
selectedstring | nullThe occurrence whose details are open
emptyView.ChildrenWhat an empty period shows under "Nothing scheduled": a button to add an event
labelstringNames the list: "Upcoming"

Source