Skip to main content

DatePicker

A control for selecting an absolute date.

Example​

const today = useMemo(() => new Date(), []);
const date = useBinding(today);
<DatePicker
title="Select a date"
selection={date}
displayedComponents={['date', 'hourAndMinute']}
/>

Props​

ColorPicker inherits all View Modifiers as props.

propdescriptiontyperequireddefault
selectionThe date valueDateyesundefined
onChangeFunction to execute when a date selection is made(v: Date) => voidnoundefined
displayedComponentsThe components to display'date' \| 'hourAndMinute' \| ('date' \| 'hourAndMinute')[];no['date', 'hourAndMinute']