Glossary Term
Intl.DateTimeFormat.prototype.formatRange()
The formatRange() method of Intl.DateTimeFormat instances formats a date range in the most concise way based on the locales and options provided when instantiating this Intl.DateTimeFormat object.
Return value: A string representing the given date range formatted according to the locale and formatting options of this Intl.DateTimeFormat object. If the start and end dates are equivalent at the precision of the output, the output will only contain a single date.
Parameters: startDate The start of the date range. Can be a Date or Temporal.PlainDateTime object. Additionally can be a Temporal.PlainTime, Temporal.PlainDate, Temporal.PlainYearMonth, or Temporal.PlainMonthDay object if the DateTimeFormat object was configured to print at least one relevant part of the date. Note: A Temporal.ZonedDateTime object will always throw a TypeError; use Temporal.ZonedDateTime.prototype.toLocaleString() or convert it to a Temporal.PlainDateTime object instead. endDate The end of the date range. Must have the same type as startDate.
Syntax example: formatRange(startDate, endDate)
Term Connections
Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.
Loading term connections…
