platform-bible-utils
    Preparing search index...

    Function formatRelativeDate

    • Formats a date relative to today, showing "Today" or "Yesterday" when applicable, otherwise returns the date in the specified format

      Parameters

      • date: Date

        The date to format

      • todayString: string

        The string to display when the date is today

      • yesterdayString: string

        The string to display when the date is yesterday

      • Optionallocale: string

        The locale to use for date formatting (defaults to user's locale)

      • options: DateTimeFormatOptions = ...

        The Intl.DateTimeFormatOptions to use for date formatting when not today/yesterday. Defaults to { year: 'numeric', month: 'short', day: 'numeric' } which produces formats like "Nov 9, 2025"

      Returns string