Skip to content
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

Fixed Android timezone issues and corresponding e2e test #472

Merged
merged 2 commits into from
Jun 3, 2021

Conversation

manojmalik20
Copy link
Contributor

Summary

I found out that the datetime picker uses the device timezone by default and if we use the prop timezoneOffsetInMinutes then it uses the utc time. Basically the prop timezoneOffsetInMinutes was not working. There was already a PR for this fix but it was failing e2e tests and the submitter was not responding since April 10 so I am making this PR in which I have fixed the issue and the e2e tests as well. The PR already made is mentioned below.

Related Pull Requests

#431

Test Plan

Display initially passed date (input)

  • (timezones: device: GMT +3, app: GMT -7)
  • pass 2021-04-09T17:00:00.000Z date (for UTC it stands for 17:00, but for app timezone -7 it should be treated like 10:00)
  • pass timeZoneOffsetInMinutes={-420} prop (-420 = -7 * 60)
  • Expected: TimePicker should display 10:00 as initial selected date
  • Actual: TimePicker displays 17:00 as initial selected date
    According to this fact, we can suppose that timezoneOffsetInMinutes prop is ignored and UTC hours & minutes are displayed instead.

What's required for testing (prerequisites)?

  • App uses fixed timezone for date handling/management (for example GMT -7)
  • Device timezone should differ from app timezone (device: GMT +3, app: GMT -7)
  • Android 🙂

What are the steps to reproduce (after prerequisites)?

Compatibility

OS Implemented
iOS
Android

Checklist

  • I have tested this on a device and a simulator

@manojmalik20 manojmalik20 requested a review from vonovak June 2, 2021 14:58
@vonovak vonovak merged commit b87a0c4 into react-native-datetimepicker:master Jun 3, 2021
@vonovak
Copy link
Member

vonovak commented Jun 3, 2021

thank you for the PR!

@manojmalik20 manojmalik20 deleted the MI-1285 branch June 3, 2021 08:35
vonovak pushed a commit that referenced this pull request Jun 3, 2021
## [3.5.2](v3.5.1...v3.5.2) (2021-06-03)

### Bug Fixes

* resolve timezoneOffsetInMinutes android bugs ([#472](#472)) ([b87a0c4](b87a0c4))
@vonovak
Copy link
Member

vonovak commented Jun 3, 2021

🎉 This PR is included in version 3.5.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants