Showing the DatePicker doesn't show the picker, just the selected date...
See original GitHub issueReally confused by this.
This is what i see when i show the datepicker. Then i have to click it again to pull up the ‘date’ mode. Then selecting a date doesn’t close the picker.
<View style={styles.content}>
<Text style={styles.contentHeadText}>Date</Text>
<TouchableOpacity style={[]} onPress={() => setShowDatePicker(true)} accessibilityRole='button'>
<Text>{moment(selectedDate).format('MMM DD')}</Text>
</TouchableOpacity>
{selectedDate && showDatePicker && (
<DateTimePicker
style={styles.dropdownContainer}
mode={'date'}
display='default'
minimumDate={now}
value={selectedDate}
onChange={handleDateChange}
textColor={'#000000'}
/>
)}
</View>
My change handler:
const handleDateChange = (event, date) => {
setSelectedDate(date)
setShowDatePicker(Platform.OS === 'ios')
}
All I want to do is select a date and have it close with my state updated…
Issue Analytics
- State:
- Created 2 years ago
- Reactions:9
- Comments:8 (1 by maintainers)
Top Results From Across the Web
Bootstrap Datepicker not displaying selected date as ...
When I select start date I update selected value into end date, but when I click on end date datepicker opens up but...
Read more >DatePicker is not showing the date after selection
Hello James, The DatePicker widget can only be initialized from an INPUT element. I will suggest you check the DatePicker Getting Started help ......
Read more >DatePicker Doesn't Set Selected Value
The start Date works fine. I select a date from the picker and the value is populated into the StartDate text value and...
Read more >Date Range Picker — JavaScript Date & Time Picker Library
A JavaScript component for choosing date ranges, dates and times. ... Originally created for reports at Improvely, the Date Range Picker can be...
Read more >Date picker - Windows apps
By default, the date picker shows the day, month, and year. If your scenario for the date picker doesn't require all the fields, ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I changed a display mode to ‘spinner’ to solve this issue.
Did you find any solution. I am also stuck on the same issue