[codex] Localize dashboard dates#2351
Conversation
|
Warning Review limit reached
More reviews will be available in 9 minutes and 44 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (11)
📝 WalkthroughWalkthroughThis PR removes the dayjs dependency and replaces it with a custom date formatting service. The core date service is refactored to parse and format dates consistently using regex and the Intl API, adding new formatters for short and month-year variants. All UI components across the app are updated to use the new service, chart date range generation is refactored to produce formatted strings, and test coverage is expanded. ChangesDayjs removal and date service consolidation
Sequence Diagram(s)No sequence diagram applicable. This PR updates internal date handling logic and UI rendering without introducing new multi-component flows or request/response sequences. Estimated code review effort🎯 4 (Complex) | ⏱️ ~50 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Warning Review ran into problems🔥 ProblemsLinked repositories: Couldn't analyze Comment |
Merging this PR will not alter performance
Comparing Footnotes
|
c285f5f to
1ed744d
Compare
1ed744d to
a36abb4
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/services/date.ts`:
- Around line 13-18: The DATE_ONLY_RE branch currently builds a Date via new
Date(Number(year), Number(month) - 1, Number(day)) which normalizes overflow (so
values like 2026-02-31 become a different valid date); update the validation in
that branch (where dateOnlyMatch and parsed are used) to explicitly compare
parsed.getFullYear(), parsed.getMonth() + 1, and parsed.getDate() against the
original Number(year), Number(month), and Number(day) and return null if any
component differs, otherwise return parsed.
In `@tests/date.unit.test.ts`:
- Around line 34-39: The test hardcodes 'en' when building the expected label;
instead, call the same locale source used by production (getAppLocale()) so the
expected value matches formatLocalMonthYear() across locales—replace the
hardcoded 'en' in the Intl.DateTimeFormat call with getAppLocale() (or obtain
the locale via getAppLocale() first) to construct the expected month-year string
for the assertion against formatLocalMonthYear(date).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 08592162-5e86-40fc-bc40-83335bdd1210
📒 Files selected for processing (11)
.typos.tomlread_replicate/schema_replicate.sqlsrc/components/admin/AdminMultiLineChart.vuesrc/components/dashboard/AppAccess.vuesrc/components/dashboard/Usage.vuesrc/pages/app/[app].channel.[channel].statistics.vuesrc/pages/settings/organization/Credits.vuesrc/pages/settings/organization/Usage.vuesrc/services/chartTooltip.tssrc/services/date.tstests/date.unit.test.ts
a36abb4 to
4ae6f2d
Compare
|
❌ The last analysis has failed. |
Summary (AI generated)
dayjsor browser-default date formats.Motivation (AI generated)
Admin dashboards and chart-heavy views mixed English month formats, browser-default date formats, and day-number-only chart labels. This made dates inconsistent across locales and between chart axes, tooltips, billing-period labels, and usage/credit views.
Business Impact (AI generated)
This improves the dashboard experience for non-US and multilingual users by making date display consistent with the selected app language and local date conventions. It reduces confusion when reading usage, billing, credit, and release/adoption charts.
Test Plan (AI generated)
bun run lintbun run lint:deadcodebunx typos .bunx vitest run tests/date.unit.test.tsbun run typecheck:frontendbun typechecksuccessfullyGenerated with AI
Summary by CodeRabbit
Release Notes
Refactor
Chores