Intl.DateTimeFormat.formatRange - Web documentation
method Intl.DateTimeFormat.formatRange
DateTimeFormat.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

T extends Formattable

Parameters

startDate: T

The start date of the range to format.

endDate: T

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

Return Type

string
DateTimeFormat.formatRange(
startDate: Date | number,
endDate: Date | number,
): string

Parameters

startDate: Date | number
endDate: Date | number

Return Type

string