sandstone/ Date Picker
Date selection components and behaviors.
import DatePicker from '@enact/sandstone/DatePicker';Members
DatePickerComponent
A date selection component, ready to use in Sandstone applications.
DatePicker may be used to select the year, month, and day. It uses a standard Date object for
its value which can be shared as the value for a
TimePicker to select both a date and time.
By default, DatePicker maintains the state of its value property. Supply the
defaultValue property to control its initial value. If you wish to directly control updates
to the component, supply a value to value at creation time and update it in response to
onChange events.
Usage:
<DatePicker
defaultValue={selectedDate}
onChange={handleChange}
/>import DatePicker from '@enact/sandstone/DatePicker';Properties
The initial value used when
valueis not set.The selected date
DatePickerBaseComponent
A date selection component.
This component is most often not used directly but may be composed within another component as it is within DatePicker.
import {DatePickerBase} from '@enact/sandstone/DatePicker';Properties
The
daycomponent of the Date.The value should be a number between 1 and
maxDays.The number of days in the month.
The number of months in the year.
The
monthcomponent of the Date.The value should be a number between 1 and
maxMonths.The order in which the component pickers are displayed.
The value should be an array of 3 strings containing one of
'm','d', and'y'.The
yearcomponent of the Date.Disables voice control.
The "aria-label" for the day picker.
If not specified, the "aria-label" for the day picker will be a combination of the current value and 'day change a value with up down button'.
Disables the
DatePicker.The primary text of the
DatePicker.The maximum selectable
yearvalue.Default: 2099The minimum selectable
yearvalue.Default: 1900The "aria-label" for the month picker.
If not specified, the "aria-label" for the month picker will be a combination of the current value and 'month change a value with up down button'.
Hides the label that displays the date.
Called when the
datecomponent of the Date changes.Called when the
monthcomponent of the Date changes.Called when the
yearcomponent of the Date changes.Called when
Enterkey down on the last pickerCalled when the component is removed when it had focus.
Called prior to focus leaving the picker when the 5-way left key is pressed.
Called prior to focus leaving the picker when the 5-way right key is pressed.
Disables 5-way spotlight from navigating into the component.
Default: falseThe "aria-label" for the year picker.
If not specified, the "aria-label" for the year picker will be a combination of the current value and 'year change a value with up down button'.
dateToLocaleStringFunction
dateToLocaleString( date )String|nullConverts a standard Date object into a locale-specific string.
1 Param
- date Date
Dateto convert
Returns
- Stringnull
Converted date or
nullifdateis invalid