Fix chat badge padding and clamp relative time labels
This commit is contained in:
parent
1d3580b187
commit
2ea0952f16
2 changed files with 3 additions and 2 deletions
|
|
@ -1018,7 +1018,8 @@ function postureSeverityClass(severity?: string | null) {
|
|||
function formatRelativeTime(date?: Date | null) {
|
||||
if (!date) return "Nunca"
|
||||
try {
|
||||
return formatDistanceToNowStrict(date, { addSuffix: true, locale: ptBR })
|
||||
const clamped = new Date(Math.min(date.getTime(), Date.now()))
|
||||
return formatDistanceToNowStrict(clamped, { addSuffix: true, locale: ptBR })
|
||||
} catch {
|
||||
return "—"
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue