Date Picker

A date field with a calendar: keyboard navigation, month and year jumps, typed words like “next fri”, and a sheet on phones.

ENG-142

Export fails on workspaces over 10 GB

Due in 9 days

Installation

pnpm dlx shadcn@latest add checkfu/uicontext/date-picker

Usage

import { DatePicker } from "./ui/uicontext/components/DatePicker.ts"
const Message = UiSchema.TaggedEnum({ PickedDue: { value: Schema.NullOr(Schema.String) } })// `today` comes from the app, in the reader's time zone: the picker never reads the clockexport const DueDate = (h: Html.H<typeof Message.Type>, due: string | null, today: string) =>	DatePicker(h, {		props: { label: "Due date", value: due, today },		onEmit: { Picked: ({ value }) => Message.PickedDue({ value }) },	})

Examples

Weekends off

Weekends and holidays are struck through and can't be picked; typing one says why. The UK week starts on Monday.

Weekdays, from tomorrow. Not on bank holidays.

API reference

Props

DatePicker props
NameTypeDefaultDescription
valuerequiredIsoDate | null—The day, as YYYY-MM-DD, or null for none
todayrequiredIsoDate—Today in the reader's time zone, from the app: the calendar marks it and starts there
localestring—The reader's locale, for the field's order, month names and the week's first day
labelrequiredstring—The visible label, which names the field and the calendar
hideLabelboolean—Keep the label for screen readers only
descriptionstring—A hint under the field
errorstring | null—The app's message about the value; it wins over the field's own
minIsoDate—The first day allowed
maxIsoDate—The last day allowed
unavailableUnavailableDates—Days that can't be picked: listed days and weekdays
firstDayOfWeekInt—The weekday weeks start on, 0 for Sunday; the locale's when left out
idstring—The field's id, unique on the page
namestring—Submits the value under this name in a form
requiredboolean——
disabledboolean——
readOnlyboolean——
clearablebooleanonShow a clear button while there's a value; on by default
typingbooleanonShow the box that takes typed words such as "next fri"; on by default

Events

DatePicker events
EventPayloadDescription
Picked{ value: IsoDate | null }A day was picked, typed or cleared (null): store it and pass it back as value

Agent actions

What agents can do with DatePicker
ActionDescription
TypedDateSet the date: an ISO day (2026-12-04), words such as "next fri", or "" to clear

Source