Skip to content

Commit ea7b91e

Browse files
alltomatosclaude
andcommitted
fix(app): pin locale for formatMinutes so unit (linux) isn't runner-dependent
`unit (linux)` was red on this PR's head, but not because of anything this PR touches: formatMinutes() called mins.toLocaleString() with no explicit locale, so its output silently depended on the process's default locale. This fork's local/dev environment produces "60.327 min" (period as thousands separator); GitHub's ubuntu-latest runner default locale produces "60,327 min" instead, failing the hardcoded unit test. This is the same root cause already diagnosed and fixed on dev directly by PR #237 (fix/stats-format-minutes-locale, closes #236) — ported verbatim here since #237 hasn't merged yet, so this PR's CI doesn't have to wait on it. Will no-op once dev carries #237. Co-Authored-By: Claude Sonnet 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01SHQKcGH7ayRe8UHJ9CAPQJ
1 parent 666441e commit ea7b91e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎packages/app/src/pages/stats/stats-controller.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,10 +115,10 @@ export function formatDuration(ms: number): string {
115115
return remHours > 0 ? `${days}d ${remHours}h` : `${days}d`
116116
}
117117

118-
export function formatMinutes(ms: number): string {
118+
export function formatMinutes(ms: number, locale?: string): string {
119119
if (!Number.isFinite(ms) || ms <= 0) return "0 min"
120120
const mins = Math.round(ms / 60000)
121-
return `${mins.toLocaleString()} min`
121+
return `${mins.toLocaleString(locale)} min`
122122
}
123123

124124
export function getCutoffTime(range: StatsDateRange, now = Date.now()): number {

0 commit comments

Comments
 (0)