fix: normalize timezone-aware usage date labels#258
fix: normalize timezone-aware usage date labels#258robinebers merged 2 commits intorobinebers:mainfrom
Conversation
🤖 Augment PR SummarySummary: Fixes incorrect day labeling for usage entries whose Changes:
Technical Notes: This change avoids falling back to 🤖 Was this summary useful? React with 👍 or 👎 |
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
I'd love to see some examples and/or screenshots to visualize this. @cubic-dev-ai review |
@robinebers I have started the AI code review. It will take a few minutes to complete. |
Problem
Some usage entries with timezone-aware timestamps (e.g.
...Z,...+09:00,...-08:00) can be labeled under the wrong day key around day/month boundaries.Root cause
Date key parsing only handled a narrow ISO shape, so timezone-bearing datetime strings were not consistently normalized to
YYYY-MM-DDbefore day-bucket matching.Fix
YYYY-MM-DDfollowed byT,t, or whitespace) in date key extraction.Tests
Added regression tests for both plugins covering boundary cases:
Z)Test command run locally:
bun run test plugins/claude/plugin.test.js plugins/codex/plugin.test.js102 passedImpact
More reliable day-label attribution for usage metrics across timezones, especially near day/month boundaries.
Fixes #254
Summary by cubic
Fixes wrong day labels for usage entries with timezone-aware timestamps by normalizing date parsing in the Claude and Codex plugins. Daily buckets like Today are now correct across timezones, including at day/month boundaries.
Written for commit 75d2072. Summary will update on new commits.