Skip to content

date picker returns next day on clicking OK on android #474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
abidhkm opened this issue Jun 4, 2021 · 7 comments
Closed

date picker returns next day on clicking OK on android #474

abidhkm opened this issue Jun 4, 2021 · 7 comments

Comments

@abidhkm
Copy link

abidhkm commented Jun 4, 2021

I'm facing one issue, Replicated that here https://snack.expo.io/pxAMzLcyP

When running it on android, the date changes to the next day upon clicking the button 'ok' multiple times even though the date in the picker is not changed.

@xdajay
Copy link

xdajay commented Jun 9, 2021

I've faced the same issue with directly using state in value prop, instead use this value={new Date(this.state.clock)}

@sanjeevkse
Copy link

@xdajay Thats a solution. It got fixed.
But it repeats,

  1. When we click on the same selected date and press ok.
  2. When we click on the next date and click back on the same date and press ok (sometimes)

@abidhkm
Copy link
Author

abidhkm commented Jun 22, 2021

Wrapping value within Date didn't help me, value={new Date(this.state.clock)}
I fixed the issue by deleting the prop timeZoneOffsetInMinutes.

@akmallmr
Copy link

akmallmr commented Aug 5, 2021

Wrapping value within Date didn't help me, value={new Date(this.state.clock)}
I fixed the issue by deleting the prop timeZoneOffsetInMinutes.

Thank you, sir.. This solved for me..

@Ashutosh-Tiwari
Copy link

Any fix for this issue?

@akmallmr
Copy link

Any fix for this issue?

If you have any datepickers props named timeZoneOffsetInMinutes, then you have to removed it @Ashutosh-Tiwari.. Last week I have a same issues, and I removed the timeZoneOffsetInMinutes props and it works for me..

@vonovak
Copy link
Member

vonovak commented Dec 11, 2021

duplicate of #528

@vonovak vonovak closed this as completed Dec 11, 2021
@react-native-datetimepicker react-native-datetimepicker locked and limited conversation to collaborators Dec 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants