UNB/ CS/ David Bremner/ teaching/ cs2613/ books/ mdn/ Reference/ Global Objects/ Intl/ DurationFormat/ Intl.DurationFormat.prototype.resolvedOptions()

The resolvedOptions() method of Intl.DurationFormat instances returns a new object with properties reflecting the locale and date and time formatting options computed during initialization of this Intl.DurationFormat object.

Syntax

resolvedOptions()

Parameters

None.

Return value

A new object with properties reflecting the locale and date and time formatting options computed during the initialization of the given Intl.DateTimeFormat object.

Description

The resulting object has the following properties:

Examples

Using the resolvedOptions method

const duration = new Intl.DurationFormat("en");
const usedOptions = duration.resolvedOptions();

usedOptions.locale; // "en"
usedOptions.numberingSystem; // "latn"
usedOptions.years; // "long"
usedOptions.yearsDisplay; // "auto"
usedOptions.style; // "long"

Specifications

Browser compatibility

See also