Open agrifriend opened 5 months ago
Ok, tried to manage to avoid it by making a slight tweak to the source code.
I changed file react-native-ui-datepicker\src\components\Header.tsx
at line 110 from this:
<View style={[styles.textContainer, theme?.headerTextContainerStyle]}>
<Text style={[styles.text, theme?.headerTextStyle]}>
{calendarView === CalendarViews.year
? `${years.at(0)} - ${years.at(-1)}`
: dayjs(currentDate).format('YYYY')}
</Text>
</View>
To this:
<View style={[styles.textContainer, theme?.headerTextContainerStyle]}>
<Text style={[styles.text, theme?.headerTextStyle]}>
{ dayjs(currentDate).format('YYYY') }
</Text>
</View>
I'm not creating a pull req for that because I assume the line I removed is supposed to do something
Maybe you don't need to use parseDateObject
in your onChange method, you can use the date passed from the onChange method to update your date value.
Or if you can provide your parseDateObject
details so I can test it.
Please check the latest (v2.0.1) version
Same issue on android
react-native: 0.71.6
react-native-ui-datepicker: 2.0.2
Bug Description I tried to implement this library on my React-Native app, but when I try to change the calendar's year by pressing the year on the calendar's header, the app immediatly crashed with the message:
Steps to Reproduce I used the lib in a pretty straight-forward way, nothing special and no particular manipulations, in "single" mode:
Code
Screenshots
Additional Information expo: 47.0.12, react: 18.1.0, react-native: 0.70.5, react-native-ui-datepicker: 2.0.0