You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix year-over-year comparisons for leap years (#4940)
When comparing dates year-over-year, the previous logic always shifted
by 365 days, which caused issues with leap years.
This means when comparing e.g. last 7 days vs a year ago in 2025, you
would compare Jan 6th and Jan 7th.
The new logic uses `Date.shift` while ensuring that the compared date
range stays the same length as original date range. This can cause some
oddities around Feb 29th where dates can get offset by 1 at the end of
the range (see tests)
Helpscout ref: https://secure.helpscout.net/conversation/2809180400/22224?viewId=6980900
0 commit comments