fix(retention): tooltip date formatting (#38530)

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
Anirudh Pillai
2025-09-25 07:56:11 +01:00
committed by GitHub
parent 5473d93435
commit 51d626e366

View File

@@ -133,6 +133,12 @@ export function getFormattedDate(input?: string | number, options?: FormattedDat
return pluralize(input as number, interval ?? 'day')
}
// Handle retention graph labels like "Day 0", "Week 12", etc.
// retention tooltips don't show the date/header, so we don't need to format it
if (typeof input === 'string' && /^(Day|Week|Month|Hour) \d+$/.test(input)) {
return input
}
const day = dayjs.tz(input, timezone)
if (input === undefined || !day.isValid()) {
return String(input)