DEV Community

Discussion on: ReactNative datetimepicker to pick both date and time in Android

Collapse
 
gtbhopale2412 profile image
gtbhopale2412

Hi @Karthikayan
Thanks for the example. I am showing the selected date/time using formatDate(date, time) method. But when i click on the Cancel button of date picker it gives me an error like : TypeError:undefined is not an object (evaluating 'date.getDate')

My Versions:
datetimepicker: 2.4.0
react-native:0.62.13
Thanks in advance for the help.

Collapse
 
22ivan22 profile image
22ivan22

Hi gtbhopale2412,
you probably have state declared like date: ' '. You should put date: new Date() and time: new Date() also