Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
320 views
in Technique[技术] by (71.8m points)

reactjs - how to use @react-native-community/datetimepicker for setting time

How can I use @react-native-community/datetimepicker to set time? I'm searching for it but can't find any answers can someone help?

question from:https://stackoverflow.com/questions/65842485/how-to-use-react-native-community-datetimepicker-for-setting-time

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You will have to set the mode

<RNDateTimePicker mode="time" />

From the docs

mode (optional) Defines the type of the picker.

List of possible values:

"date" (default for iOS and Android and Windows)
"time"
"datetime" (iOS only)
"countdown" (iOS only)

You can refer the docs here

https://www.npmjs.com/package/@react-native-community/datetimepicker#mode-optional


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...