Skip to content

fix(time-range): use UTC date methods for 90-day backfill calculation#897

Merged
BYK merged 1 commit intomainfrom
fix/time-range-utc-dates
Apr 30, 2026
Merged

fix(time-range): use UTC date methods for 90-day backfill calculation#897
BYK merged 1 commit intomainfrom
fix/time-range-utc-dates

Conversation

@BYK
Copy link
Copy Markdown
Member

@BYK BYK commented Apr 30, 2026

Summary

  • Use getUTCDate()/setUTCDate() instead of getDate()/setDate() for the 90-day date backfill in timeRangeToApiParams()
  • The input is a UTC ISO 8601 string, so date arithmetic should use UTC methods to avoid off-by-one-day errors in non-UTC timezones

Flagged by Cursor Bugbot on #892 (comment).

The open-ended date range backfill used getDate()/setDate() which
operate in the local timezone. When the machine's timezone differs
from UTC, this could produce an off-by-one-day error at the start
boundary.

Switch to getUTCDate()/setUTCDate() to match the UTC format of
the input ISO 8601 date string.

Flagged by Cursor Bugbot on #892.
@github-actions
Copy link
Copy Markdown
Contributor

PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://cli.sentry.dev/_preview/pr-897/

Built to branch gh-pages at 2026-04-30 20:42 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@github-actions
Copy link
Copy Markdown
Contributor

Codecov Results 📊

6410 passed | Total: 6410 | Pass Rate: 100% | Execution Time: 0ms

📊 Comparison with Base Branch

Metric Change
Total Tests 📈 +7
Passed Tests 📈 +7
Failed Tests
Skipped Tests

All tests are passing successfully.

✅ Patch coverage is 100.00%. Project has 13195 uncovered lines.
✅ Project coverage is 76.01%. Comparing base (base) to head (head).

Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
+ Coverage    75.95%    76.01%    +0.06%
==========================================
  Files          295       295         —
  Lines        55028     55013       -15
  Branches         0         0         —
==========================================
+ Hits         41794     41818       +24
- Misses       13234     13195       -39
- Partials         0         0         —

Generated by Codecov Action

@BYK BYK merged commit 30fcc3e into main Apr 30, 2026
24 checks passed
@BYK BYK deleted the fix/time-range-utc-dates branch April 30, 2026 23:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant