Skip to main content

formatRange

method Intl.DateTimeFormat.formatRange
Jump to headingDateTimeFormat.formatRange<T extends Formattable>(
startDate: T,
endDate: T,
): string

Format a date range in the most concise way based on the locale and options provided when instantiating this Intl.DateTimeFormat object.

Type Parameters Jump to heading

Parameters Jump to heading

The start date of the range to format.

The start date of the range to format. Must be the same type as startRange.

Return Type Jump to heading

string
Jump to headingDateTimeFormat.formatRange(
startDate: Date | number,
endDate: Date | number,
): string

Parameters Jump to heading

Jump to headingstartDate: Date | number
Jump to headingendDate: Date | number

Return Type Jump to heading

string
Back to top