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

Fix date range timezones #1816

Merged
merged 7 commits into from
Dec 23, 2020
Merged

Conversation

malinajirka
Copy link
Contributor

@malinajirka malinajirka commented Dec 22, 2020

Parent issue wordpress-mobile/WordPress-Android#13268

This PR adjusts after/before dates based on the current timezone.

When the user selects a date range eg. 10-12th of January, they expect to see data for 10-12th in their timezone. Therefore the app needs to adjust the date range based on the current timezone of the device.

For example
2020-01-10T00:00:00+00:00 becomes 2020-01-09T21:00:00+00:00 when the device's timezone is GMT+3. The user selected "10th of January" which is "9th of January 21pm" in GMT+0 (server timezone).

To test:
Test in WPAndroid wordpress-mobile/WordPress-Android#13655

Copy link
Contributor

@ashiagr ashiagr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as described 👍.

Thank you so much for fixing tricky timezone issues and also adding tests which made reviewing easier!

@malinajirka malinajirka merged commit ab7222f into develop Dec 23, 2020
@malinajirka malinajirka deleted the issue/13268-fix-date-range-timezones branch December 23, 2020 10:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants