DateTimePicker
Date and Time Picker Component that wraps RNDateTimePicker for date and time modes. See: https://github.com/react-native-community/react-native-datetimepicker#react-native-datetimepicker
(code example)
This component extends TextField props.
DateTimePicker uses a native library. You MUST add and link the native library to both iOS and Android projects
Usageβ
<DateTimePicker title={'Select time'} placeholder={'Placeholder'} mode={'time'}/>
APIβ
cancelButtonPropsβ
Cancel button props
ButtonProps
confirmButtonPropsβ
Confirm button props
ButtonProps
dateTimeFormatterβ
A callback function to format the time or date
(value: Date, mode: DateTimePickerMode) => string
dialogPropsβ
Props to pass the Dialog component
DialogProps
displayβ
Defines the visual display of the picker. The default value is 'spinner' on iOS and 'default' on Android. The list of all possible values are default, spinner, calendar or clock on Android and default, spinner, compact or inline for iOS. Full list can be found here: https://github.com/react-native-datetimepicker/datetimepicker#display-optional
string
editableβ
Should this input be editable or disabled
boolean
headerStyleβ
Style to apply to the iOS dialog header
ViewStyle
is24Hourβ
Android onlyβ
Allows changing of the time picker to a 24 hour format
boolean
localeβ
iOS onlyβ
Allows changing of the locale of the component
string
maximumDateβ
The maximum date or time value to use
Date
minimumDateβ
The minimum date or time value to use
Date
minuteIntervalβ
iOS onlyβ
The interval at which minutes can be selected. Possible values are: 1, 2, 3, 4, 5, 6, 10, 12, 15, 20, 30
number
modeβ
The type of picker to display ('date' or 'time')
DATE | TIME
onChangeβ
Called when the date/time change
() => Date
renderInputβ
Render custom input
JSX.Element
themeVariantβ
Override system theme variant (dark or light mode) used by the date picker
LIGHT | DARK
timeZoneOffsetInMinutesβ
iOS onlyβ
Allows changing of the timeZone of the date picker. By default it uses the device's time zone
number
valueβ
Defaults to device's date and timeβ
The initial value to set the picker to
Date