Skip to content

Conversation

@irfano
Copy link
Member

@irfano irfano commented Mar 1, 2024

Fixes #20334

This fixes showing incorrect date range on the bar chart on TRAFFIC tab.

StatsDateFormatter adds "23:59" as time while parsing the day. In a case like the site timezone is 0, device timezone is -1, it fetches one day later from the current day. Removing "23:59" and making the time "00:00" resolved the issue.

before after

To Test:

  1. Log in JP.
  2. Select a site that has timezone 0.
  3. Change the device timezone to -1.
  4. Open the Stats Traffic tab
  5. Tap "By day" and change it to "By week"
  6. Verify that the date range of the date picker is same with the one shown on the chart

Regression Notes

  1. Potential unintended areas of impact

    • None.
  2. What I did to test those areas of impact (or what existing automated tests I relied on)

    • N/A.
  3. What automated tests I added (or what prevented me from doing so)

    • The issue was caused by a logic from 3rd party lib (FluxC). It's not possible to add automated test in WPAndroid.

PR Submission Checklist:

  • I have completed the Regression Notes.
  • 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.

Testing Checklist:

  • WordPress.com sites and self-hosted Jetpack sites.
  • Portrait and landscape orientations.
  • Light and dark modes.
  • Fonts: Larger, smaller and bold text.
  • High contrast.
  • Talkback.
  • Languages with large words or with letters/accents not frequently used in English.
  • Right-to-left languages. (Even if translation isn’t complete, formatting should still respect the right-to-left layout)
  • Large and small screen sizes. (Tablet and smaller phones)
  • Multi-tasking: Split screen and Pop-up view. (Android 10 or higher)

@irfano irfano added this to the 24.4 milestone Mar 1, 2024
@irfano irfano requested review from aditi-bhatia, notandyvee and ravishanker and removed request for ravishanker March 1, 2024 21:23
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is assigned to the milestone 24.4. This milestone is due in less than 4 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

WordPress📲 You can test the changes from this Pull Request in WordPress by scanning the QR code below to install the corresponding build.
App NameWordPress WordPress
FlavorJalapeno
Build TypeDebug
Versionpr20362-e280ec1
Commite280ec1
Direct Downloadwordpress-prototype-build-pr20362-e280ec1.apk
Note: Google Login is not supported on these builds.

@wpmobilebot
Copy link
Contributor

Jetpack📲 You can test the changes from this Pull Request in Jetpack by scanning the QR code below to install the corresponding build.
App NameJetpack Jetpack
FlavorJalapeno
Build TypeDebug
Versionpr20362-e280ec1
Commite280ec1
Direct Downloadjetpack-prototype-build-pr20362-e280ec1.apk
Note: Google Login is not supported on these builds.

Copy link
Contributor

@aditi-bhatia aditi-bhatia left a comment

Choose a reason for hiding this comment

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

LGTM, fixes the issue 👍

@codecov
Copy link

codecov bot commented Mar 1, 2024

Codecov Report

Attention: Patch coverage is 0% with 7 lines in your changes are missing coverage. Please review.

Project coverage is 40.15%. Comparing base (6a24dff) to head (e280ec1).
Report is 11 commits behind head on trunk.

Files Patch % Lines
...h/lists/sections/traffic/TrafficOverviewUseCase.kt 0.00% 7 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##            trunk   #20362      +/-   ##
==========================================
- Coverage   40.15%   40.15%   -0.01%     
==========================================
  Files        1476     1476              
  Lines       68270    68275       +5     
  Branches    11329    11329              
==========================================
  Hits        27417    27417              
- Misses      38344    38349       +5     
  Partials     2509     2509              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@aditi-bhatia aditi-bhatia merged commit 4dfebc9 into trunk Mar 2, 2024
@aditi-bhatia aditi-bhatia deleted the issue/20334-fix-incorrect-date-range branch March 2, 2024 08:40
@irfano irfano mentioned this pull request Mar 2, 2024
15 tasks
@irfano irfano added the Stats label Mar 21, 2024
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.

Stats Traffic By Week chart uses incorrect date range

5 participants