web-ridge / react-native-paper-dates

Smooth and fast cross platform Material Design date and time picker for React Native Paper
https://www.reactnativepaperdates.com
MIT License
640 stars 164 forks source link

Header displaying one day behind #279

Closed albertwickman closed 1 year ago

albertwickman commented 1 year ago

### Current behaviour When in the DatePickerModal, the header, shows one day behind as seen in the image below

Expected behaviour

That the same date is shown in the header, as the date(s) that are selected in the picker.

Preview

Screenshot_2023-03-23_123642

What have you tried so far?

Trying to modify dates that are passed into the DatePickerModal

Your Environment

software version
android x
react-native x.x.x
react-native-paper x.x.x
node 14.15.0
npm 7.21.0
github-actions[bot] commented 1 year ago

Hey! Thanks for opening the issue. Can you provide a minimal repro which demonstrates the issue? Posting a snippet of your code in the issue is useful, but it's not usually straightforward to run. A repro will help us debug the issue faster. Please try to keep the repro as small as possible. The easiest way to provide a repro is on snack.expo.dev. If it's not possible to repro it on snack.expo.dev, then you can also provide the repro in a GitHub repository.

Za-Sing commented 1 year ago

I can confirm this issue, here is a repro based on the official snack example: https://snack.expo.dev/oXbouiz8S

Defining a Date and using it as value, it displays one day behind in the input and the picker

iM-GeeKy commented 1 year ago

Here is a working example https://snack.expo.dev/@fitzwabs/2148fb, note the date format. Here's a thread explaining the bizarre behavior when using a format such as YEAR-MONTH-DAY.