I found a bunch of date time picker project on github, none of the work with expo. Or have to react-link which I can't because I'm in expo 100% js. Could be there a usable project somewhere?
import React, {useState} from 'react'; import {View, Button, Platform, SafeAreaView , StyleSheet} from 'reactnative'; import DateTimePicker from '@react-native-community/datetimepicker'; export default function App() { const [mydate, setDate] = useState(new Date()); const [displaymode, setMode] = useState('time'); ...
react-native-modal-datetime-picker
https://github.com/mmazzarolo/react-native-modal-datetime-picker
You can also find other expo compatible components at https://www.native.directory/
Right now they recommend using reaact-native-community/react-native-datetimepicker It works quite well.
installation with
expo install @react-native-community/datetimepicker
Expo themselves don't have a lot in their documentation but you can find it here: expo datetimepicker docs
A very basic usage looks like this:
<DateTimePicker value={date}
mode={mode}
is24Hour={true}
display="default"
onChange={this.setDate} />
You can read a bunch more on this component in the readme file of the official component docs.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With