Date and Time Picker

A day, a time and a time zone together, with daylight-saving changes handled and the time in the reader's own zone.

Rosa Tanaka

Onboarding advisor · 30 minutes

Call

Time zone

That's Fri, Dec 4, 4:30 PM your time (Berlin).

Friday, December 4 at 10:30 AM (America/New York). Stored as 2026-12-04T15:30:00.000Z.

Installation

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

Usage

import { DateTimePicker } from "./ui/uicontext/components/DateTimePicker.ts"
const Message = UiSchema.TaggedEnum({	PickedStart: { value: Schema.NullOr(Schema.String), timeZone: Schema.String, instant: Schema.NullOr(Schema.String) },})// store the instant to schedule with; keep the wall time and zone to show it againexport const Starts = (h: Html.H<typeof Message.Type>, start: string | null, zone: string, now: string) =>	DateTimePicker(h, {		props: { label: "Starts", value: start, timeZone: zone, now, zonePicker: true },		onEmit: { Picked: (picked) => Message.PickedStart(picked) },	})

Examples

Clock changes

A time the clocks skip moves to the one that happens, and a time that happens twice is the first. Either way, a note says so.

Maintenance starts

2:30 AM doesn't happen on Sun, Mar 14 in New York: the clocks go forward. It's set for 3:30 AM.

API reference

Props

DateTimePicker props
NameTypeDefaultDescription
valuerequiredIsoDateTime | null—The wall-clock time in timeZone, as YYYY-MM-DDTHH:mm, or null for none
timeZoneTimeZoneId—The zone the value is in; the reader's when left out
nowrequiredstring—The app's current instant (ISO): today, and each zone's offset, come from it
zonePickerboolean—Show the time zone menu
localZoneTimeZoneId—The reader's own zone, for the note and the zone list; the browser's when left out
localestring——
labelrequiredstring—Names the group: "Starts", "Delivery"
hideLabelboolean——
stepInt30Minutes between the times listed; 30 by default
hour12boolean——
minIsoDate——
maxIsoDate——
unavailableUnavailableDates——
errorstring | null—The app's message about the value
idstring——
disabledboolean——
readOnlyboolean——

Events

DateTimePicker events
EventPayloadDescription
Picked{ value: IsoDateTime | null; timeZone: TimeZoneId; instant: string | null }A new day, time or zone: store value and timeZone; instant is the moment they name, as an ISO timestamp in UTC (null while the value is)

Source