DatePicker
The DatePicker
component allows users to choose a specific date from a
calendar or enter it via keyboard.
Import
import { DatePicker } from '@dynatrace/strato-components-preview/forms';
Use cases
Control the state
The date picker can be controlled, meaning that you can handle the state. To do
so, you need to use the onChange
prop to provide a handler that is called when
the internal state of the date picker changes. You also need to assign the value
from the state to the date picker by setting the value
prop. The value can
either be an ISO string or null. The onChange
is not called with the new value
if the date could not be parsed (e.g. if the user types an invalid date).