Repository navigation
fix: stop treating daily dates on the 1st as month-only labels - #71
Conversation
The heuristic dateString.endsWith('-01') was used in both formatDate
and getShortDate to decide whether a date is a monthly aggregate label
(always YYYY-MM-01) or an actual daily date. This breaks when a daily
data point falls on the 1st of the month — it gets displayed as just
the month name instead of the specific date.
Replace the heuristic with an explicit 'monthly' parameter so
callers that render monthly aggregates pass true and daily-data
callers pass false (the default).
Co-Authored-By: Claude <noreply@anthropic.com>
formatDate uses new Date('YYYY-MM-DD') which interprets the string as
UTC midnight. For users in timezones west of UTC (Americas, Europe),
this rolls the date back by a day, causing monthly labels in the All
tab to show the previous month (e.g. 'May 2026' for June 2026 data).
Parse textually and build a Date via Date.UTC with an explicit
timeZone: 'UTC' in toLocaleDateString instead. The date keys from
dayKeyInZone / monthKeyInZone are already timezone-aware, so UTC
formatting preserves the correct display.
Co-Authored-By: Claude <noreply@anthropic.com>
|
Thanks @YuboZhang — clean refactor (explicit One note so we don't accidentally consider #54 closed by this: 🤖 Generated with Claude Code |
|
Yes, @Carl723000 I found and fixed the issue #54 too in this PR. If it has been fixed, you can close this PR. Thanks. |
|
Correction: this PR has been reopened. Its implementation must enter 🤖 Generated with OpenAI Codex |
…ge#72 Preserve the merged contributor fixes as the base while retaining the reviewed V2.2.1 testability and automation-hardening follow-ups.\n\n---\n🤖 Generated with [OpenAI Codex](https://developers.openai.com/codex/)
Summary
Fixes a date formatting bug in the This Month tab's daily breakdown table: days that fall on the 1st of the month (e.g.
2026-07-01) were displayed as month names ("July 2026") instead of specific dates ("2026/7/1"). BothformatDateandgetShortDateuseddateString.endsWith('-01')as a heuristic to distinguish monthly aggregate labels from daily dates, which breaks for any daily data point on the 1st. The fix replaces the heuristic with an explicitmonthlyparameter so the caller indicates the intended context.Linked issues
None
Type of change
fix(patch)feature(minor)breaking(major)docs/ci/chore(patch)How was this tested?
.vsix(npx @vscode/vsce package) and installed it in VS Code2026/7/1)npm run compileis cleanChecklist
npm run compileis cleanI18nwith all six languages filled — N/A, only date formatting logic changedCHANGELOG.mdupdated (user-visible changes)README.mdupdated if behaviour/settings changed — N/A