Skip to content

Issue/13268 date range fixes#13655

Merged
malinajirka merged 11 commits intodevelopfrom
issue/13268-date-range-fixes
Dec 23, 2020
Merged

Issue/13268 date range fixes#13655
malinajirka merged 11 commits intodevelopfrom
issue/13268-date-range-fixes

Conversation

@malinajirka
Copy link
Copy Markdown
Contributor

@malinajirka malinajirka commented Dec 22, 2020

Parent issue #13268

This PR fixes a few issues related to DateRange filtering in Activity Log

Merge instructions:

  1. Make sure Issue/13268 data filtering #13647 is merged
  2. Update FLuxC hash with tag (Fix date range timezones WordPress-FluxC-Android#1816)
  3. Remove the "Not Ready for Merge label"
  4. Merge this PR

Issue 1

DateRange provided by the MaterialDateRangePicker is in GMT+0. However, the user wants to see data for dateRange in their timezone not in UTC. This issue is fixed in FluxC - more info on this PR.
Fixed in 92876fd

Issue 2

Label on the dateRange filter chip was being formatted using device timezone. However, MaterialDateRangePicker is using GMT+0. This lead to an issue when device timezone was GMT-N. For example when the user selected "Nov 10-12th" in "GMT-7", the label was "Nov 9 - 11".
This issue is fixed in caa13cf

Issue 3

When user selected any date range, the end date was set to start of the day instead of end of the day. This lead to multiple issues. For example selecting date range for a single day "Nov 10-10" would never show any data, since the range had duration equal to 0seconds.
Fixed in 214cc2d

To test:

  1. Set device timezone to "GMT-7"(Denver)
  2. Restart the app
  3. Open Activity Log
  4. Open Date Range filter
  5. Select 10-12th of December 2020
  6. Start Stetho or an alternative -> Click on Apply/Save
  7. Verify the label is "Dec 10 - 12" (it was "Dec 9 - 11" before this PR) (Issue 2)
  8. Look at Stetho and verify the request
    a) Timezone is GMT+0 (contains +00:00) (this change was not necessary but I decided to stay consistent with calypso)
    b) Date range is taking into account user timezone (it's 7 hours from midnight since we are using GMT-7) (Issue 1)
    c) before(range end) parameter is selected date plus 23h 59m 59s

?page=1&number=10&after=2020-12-10T07:00:00+00:00&before=2020-12-13T06:59:59+00:00&_locale=en_US

PR submission checklist:

  • I have considered adding unit tests where possible.
  • I have considered adding accessibility improvements for my changes.
  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Dec 22, 2020

You can trigger optional UI/connected tests for these changes by visiting CircleCI here.

@malinajirka malinajirka mentioned this pull request Dec 22, 2020
31 tasks
@peril-wordpress-mobile
Copy link
Copy Markdown

peril-wordpress-mobile bot commented Dec 22, 2020

You can test the changes on this Pull Request by downloading the APK here.

Copy link
Copy Markdown
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.

Great job @malinajirka! All issues fixed and tests passed 👏.

Issue 1 ✅
Issue 2 ✅
Issue 3 ✅

Thank you once again for fixing these tricky issues!

Base automatically changed from issue/13268-data-filtering to develop December 23, 2020 11:13
@malinajirka malinajirka merged commit b1c3148 into develop Dec 23, 2020
@malinajirka malinajirka deleted the issue/13268-date-range-fixes branch December 23, 2020 11:25
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