Date field
import { DateField, DateTimeField, Calendar, formatDay } from "@arcadia/ui";With a time
DateField
valuerequired- Day | null
- The day,
YYYY-MM-DD, or none. onChangerequired- (day: Day | null) => void
- Called with the day picked or typed (every typed day that reads, the same one too), or null when cleared.
onRefuse- (text: string) => void
- Called with a typed text it cannot read, or a day past
minormax: the field keeps its day and is marked invalid until the text changes, and the product gives the error line throughField'serror. min- Day
- The first day that can be picked or typed.
max- Day
- The last day that can be picked or typed.
today- Day
- The day it is, given by the product so a test and a server agree. Default: the machine's own day.
locale- string
- The reader's locale: the day's words, the month names it reads, the calendar's week. Default: the platform's.
size- "sm" | "md" | "lg"
- Default:
"md" - Beside an
Inputof the same size. variant- "default" | "ghost" | "bar" | "edge"
invalid- boolean
- Marks it invalid; a surrounding
Fieldwitherrordoes it too. clearable- boolean
false: no clear control, and an emptied text keeps the day.revealClearOnInteraction- boolean
rootStyle- InputStyle
- Typed StyleX override for the field's frame: where it sits and
Input's--input-*knobs.
Rest props go to <input> props.
valuerequired- number | null
onChangerequired- (ms: number | null) => void
defaultTime- string
- Default:
"17:00" min- number
max- number
clearable- boolean
- Default:
true size- "sm" | "md" | "lg"
- Default:
"md" - The text style it stands in and its height, as
Input's:sm24px Caption,md28px Body,lg32px Headline. invalid- boolean
showZone- boolean
- Default:
true aria-label- string
rootStyle- RootStyle
- A component's typed override prop:
Layoutand its documented knobs, each the references it takes or another kit knob of its kind; anything else is a type error at the call site (STYLEX.md).
value- Day | null
- Default:
null - The day picked,
YYYY-MM-DD, or none. range- { first: Day; last?: Day | null } | null
- A range of days in the place of one: every day from
firsttolastis chosen, the two ends among them, andfirstalone while the last is still to be pressed.valueis not read beside it. onChange- (day: Day) => void
- Called with the day a person picks: a click, or Enter or Space on it.
min- Day
- The first day that can be picked; days before it are drawn disabled and the keys skip them.
max- Day
- The last day that can be picked.
today- Day
- The day it is, given by the product so a test and a server agree. Default: the machine's own day.
locale- string
- The reader's locale: the names of months and days, and the week's first day (its week info, Monday where the platform says nothing). Default: the platform's.
rootStyle- RootStyle
- Typed StyleX override: where the calendar sits.
Rest props go to <div> props.