-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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: notification dates edge case #25148
fix: notification dates edge case #25148
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
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. |
const elapsed = Math.abs(Date.now() - date.getTime()); | ||
const diffDays = elapsed / (1000 * 60 * 60 * 24); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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