Closed daviwesley closed 4 years ago
onDateChange={date => { setDate(new Date(date)) }}
getDateStr={date => format(new Date(date), "d MMMM yyyy")}
I think this can be a solution of your problem ,because date picker return date format in string and the date-fns need Date object to format it.
it worked like a charm! ty!
Issue
I am using
date-fns
to format the date but when I change to a different date I get this errorRange Error: Invalid time value
Expected Behavior
Show formated date and chage the date
Code
Environment
react-native -v
: react-native: 0.59.3node -v
: v10.16.3npm -v
: 6.9.0yarn --version
:target platform
: Androidoperating system
: Ubuntu