fix: notification dates edge case#25148
Merged
Prithpal-Sooriya merged 1 commit intodevelopfrom Jun 13, 2024
Merged
Conversation
due to manual date diffing, there were some weirdness with the dates displayed (such as a notification yesterday, but not 24 hours ago). This fix (using date built-ins) ensures correct notification dates. NOTE - need to port this on other platforms
Contributor
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Prithpal-Sooriya
commented
Jun 7, 2024
Comment on lines
-37
to
-38
| const elapsed = Math.abs(Date.now() - date.getTime()); | ||
| const diffDays = elapsed / (1000 * 60 * 60 * 24); |
Contributor
Author
There was a problem hiding this comment.
Not using manual date diffing, instead using the Date object to check if dates are yesterday, today, or in same year (for more accurate notifications).
See test scenarios for more info.
Collaborator
Builds ready [65f11f2]
Page Load Metrics (164 ± 218 ms)
Bundle size diffs
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #25148 +/- ##
===========================================
+ Coverage 65.76% 65.77% +0.01%
===========================================
Files 1362 1362
Lines 54101 54110 +9
Branches 14045 14048 +3
===========================================
+ Hits 35579 35588 +9
Misses 18522 18522 ☔ View full report in Codecov by Sentry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Due to manual date comparisons, there were some weirdness with the dates displayed (such as a notification yesterday, but not 24 hours ago). This fix (using date built-ins) ensures correct notification dates.
NOTE - need to port this on other platforms.
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist