mirror of
https://github.com/anomalyco/opencode.git
synced 2026-02-01 22:48:16 +00:00
fix(ui): improve zh duration display formatting (#10844)
This commit is contained in:
@@ -390,12 +390,14 @@ export function SessionTurn(
|
|||||||
const interval = Interval.fromDateTimes(from, to)
|
const interval = Interval.fromDateTimes(from, to)
|
||||||
const unit: DurationUnit[] = interval.length("seconds") > 60 ? ["minutes", "seconds"] : ["seconds"]
|
const unit: DurationUnit[] = interval.length("seconds") > 60 ? ["minutes", "seconds"] : ["seconds"]
|
||||||
|
|
||||||
return interval.toDuration(unit).normalize().reconfigure({ locale: i18n.locale() }).toHuman({
|
const locale = i18n.locale()
|
||||||
|
const human = interval.toDuration(unit).normalize().reconfigure({ locale }).toHuman({
|
||||||
notation: "compact",
|
notation: "compact",
|
||||||
unitDisplay: "narrow",
|
unitDisplay: "narrow",
|
||||||
compactDisplay: "short",
|
compactDisplay: "short",
|
||||||
showZeros: false,
|
showZeros: false,
|
||||||
})
|
})
|
||||||
|
return locale.startsWith("zh") ? human.replaceAll("、", "") : human
|
||||||
}
|
}
|
||||||
|
|
||||||
const autoScroll = createAutoScroll({
|
const autoScroll = createAutoScroll({
|
||||||
|
|||||||
Reference in New Issue
Block a user