Deferred from PR #363 (CodeRabbit review: #363 (comment)).
Problem
formatShortDate(iso) (src/utils/dateInput.ts) formats via the browser locale (toLocaleDateString() with no locale argument), so tooltip dates can differ from the user's selected app language. This surfaced in the Statistics trend-chart tooltips:
src/components/Statistics/ClassTrendChart.tsx (tooltip label formatter)
src/components/Statistics/MultiClassTrendChart.tsx (tooltip label formatter)
- other
formatShortDate callers repo-wide
Why deferred
formatShortDate is a shared utility used across many charts/exports. Making it locale-aware is a cross-cutting change best done as one consistent pass (util signature + all callers) rather than a one-off in the two trend tooltips.
Suggested work
- Add an optional locale parameter to
formatShortDate (e.g. formatShortDate(iso, locale?)), passing it through to toLocaleDateString(locale, ...).
- Update callers that render user-visible dates to pass the active
i18n.language.
- Confirm no regression in export utilities that call it.
Scope: small–medium. Non-blocking; no functional bug, just locale consistency.
Deferred from PR #363 (CodeRabbit review: #363 (comment)).
Problem
formatShortDate(iso)(src/utils/dateInput.ts) formats via the browser locale (toLocaleDateString()with no locale argument), so tooltip dates can differ from the user's selected app language. This surfaced in the Statistics trend-chart tooltips:src/components/Statistics/ClassTrendChart.tsx(tooltip label formatter)src/components/Statistics/MultiClassTrendChart.tsx(tooltip label formatter)formatShortDatecallers repo-wideWhy deferred
formatShortDateis a shared utility used across many charts/exports. Making it locale-aware is a cross-cutting change best done as one consistent pass (util signature + all callers) rather than a one-off in the two trend tooltips.Suggested work
formatShortDate(e.g.formatShortDate(iso, locale?)), passing it through totoLocaleDateString(locale, ...).i18n.language.Scope: small–medium. Non-blocking; no functional bug, just locale consistency.