Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

538 B
Raw Blame
import type { EventsRetentionApi } from 'products/product_analytics/frontend/generated/api.schemas'

export type EventsPassSchedule = Pick<
    EventsRetentionApi,
    'scheduled_pass_on' | 'first_pass_on' | 'default_period_deletes'
>

export function nextPassOn(schedule: EventsPassSchedule): string | null {
    if (!schedule.default_period_deletes || schedule.scheduled_pass_on === null) {
        return null
    }
    return schedule.first_pass_on > schedule.scheduled_pass_on ? schedule.first_pass_on : schedule.scheduled_pass_on
}