Skip to content

Commit 90a7e3d

Browse files
authored
fix(ui): improve zh duration display formatting (#10844)
1 parent 33dc70b commit 90a7e3d

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/ui/src/components/session-turn.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -390,12 +390,14 @@ export function SessionTurn(
390390
const interval = Interval.fromDateTimes(from, to)
391391
const unit: DurationUnit[] = interval.length("seconds") > 60 ? ["minutes", "seconds"] : ["seconds"]
392392

393-
return interval.toDuration(unit).normalize().reconfigure({ locale: i18n.locale() }).toHuman({
393+
const locale = i18n.locale()
394+
const human = interval.toDuration(unit).normalize().reconfigure({ locale }).toHuman({
394395
notation: "compact",
395396
unitDisplay: "narrow",
396397
compactDisplay: "short",
397398
showZeros: false,
398399
})
400+
return locale.startsWith("zh") ? human.replaceAll("、", "") : human
399401
}
400402

401403
const autoScroll = createAutoScroll({

0 commit comments

Comments
 (0)