roto93 / react-native-neat-date-picker

An easy to use date picker for react native.
MIT License
50 stars 29 forks source link

minDate prop don't works fine in android #17

Open diecodev opened 1 year ago

diecodev commented 1 year ago

Here is mi code:

import DatePicker from 'react-native-neat-date-picker';

return (
  <DatePicker
      isVisible={showDatePicker}
      mode={'single'}
      onCancel={onCancel}
      onConfirm={onConfirm}
      initialDate={date}
      startDate={date}
      minDate={new Date()}
  />
)

Date Picker error with minDate prop

The minDate is 25-07-2022 but, the picker dont let choose that day. I will try to make a PR when I fix it.

diecodev commented 1 year ago

Update:

It looks like its a problem with minDate internal function, it compares entire date gaves by developer with the date in central timezone (T00:00:00Z) and that is the problem. I'd like to make a PR with a custom hook to use when someone needs to use this prop.