mirror of
https://github.com/BillyOutlast/posthog.git
synced 2026-02-04 03:01:23 +01:00
fix(retention): tooltip date formatting (#38530)
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user