How do I view the selected date in a textInput? #634
-
I'm a newbie and can anyone please tell me how am I able to view the date that I choose from the calendar in a textInput. If you wanna know, I need that for client-side to choose their date of birth in register page. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
You can save on local state, and then put local state which contains picked date in TextInput |
Beta Was this translation helpful? Give feedback.
-
As @itzmail said but in more detail: You will need to import useState from react...
Setup your states
setup functions
setup handler for state changes and hiding the picker.
lastly setup the date picker. just remember to set the value of the TextInput with a turnery function like this making sure you get the appropriate country code for your time format.
Hope this helps... |
Beta Was this translation helpful? Give feedback.
You can save on local state, and then put local state which contains picked date in TextInput