The date to format
The string to display when the date is today
The string to display when the date is yesterday
Optionallocale: stringThe locale to use for date formatting (defaults to user's locale)
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"
Formats a date relative to today, showing "Today" or "Yesterday" when applicable, otherwise returns the date in the specified format