File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -213,14 +213,14 @@ export const StatsPage: Component = () => {
213213 < KpiCard
214214 label = { language . t ( "stats.kpi.totalDuration" ) }
215215 value = { formatDuration ( stats ( ) . totalDurationMs ) }
216- fullValue = { formatMinutes ( stats ( ) . totalDurationMs ) }
217- subtext = { formatMinutes ( stats ( ) . totalDurationMs ) }
216+ fullValue = { formatMinutes ( stats ( ) . totalDurationMs , language . intl ( ) ) }
217+ subtext = { formatMinutes ( stats ( ) . totalDurationMs , language . intl ( ) ) }
218218 accent = "blue"
219219 />
220220 < KpiCard
221221 label = { language . t ( "stats.kpi.longestDuration" ) }
222222 value = { formatDuration ( stats ( ) . longestDurationMs ) }
223- fullValue = { formatMinutes ( stats ( ) . longestDurationMs ) }
223+ fullValue = { formatMinutes ( stats ( ) . longestDurationMs , language . intl ( ) ) }
224224 subtext = { stats ( ) . longestSessionTitle ? `${ stats ( ) . longestSessionTitle } ` : language . t ( "stats.kpi.longestDuration.sub" ) }
225225 accent = "amber"
226226 />
@@ -453,7 +453,7 @@ export const StatsPage: Component = () => {
453453 < td class = "py-2.5 pr-2 text-right font-mono text-11-medium text-v2-text-text-base" >
454454 { compactFmt ( ) . format ( s . tokensTotal ) }
455455 </ td >
456- < td class = "py-2.5 pr-2 text-right font-mono text-11-medium text-blue-400" title = { formatMinutes ( s . durationMs ) } >
456+ < td class = "py-2.5 pr-2 text-right font-mono text-11-medium text-blue-400" title = { formatMinutes ( s . durationMs , language . intl ( ) ) } >
457457 { s . durationFormatted }
458458 </ td >
459459 < td class = "py-2.5 pr-2 text-right font-mono text-11-regular text-v2-text-text-muted" >
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ describe("formatDuration", () => {
3939
4040 test ( "formatMinutes formats total minutes" , ( ) => {
4141 expect ( formatMinutes ( 3600000 ) ) . toBe ( "60 min" )
42- expect ( formatMinutes ( 3619620000 ) ) . toBe ( "60.327 min" )
42+ expect ( formatMinutes ( 3619620000 , "pt-BR" ) ) . toBe ( "60.327 min" )
4343 } )
4444} )
4545
Original file line number Diff line number Diff 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
124124export function getCutoffTime ( range : StatsDateRange , now = Date . now ( ) ) : number {
You can’t perform that action at this time.
0 commit comments