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

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

Syntax

resolvedOptions()

Parameters

None.

Return value

A new object with properties reflecting the locale and number formatting options computed during the initialization of the given Intl.RelativeTimeFormat object.

Description

The resulting object has the following properties:

Examples

Using the resolvedOptions() method

const de = new Intl.RelativeTimeFormat("de-DE");
const usedOptions = de.resolvedOptions();

usedOptions.locale; // "de-DE"
usedOptions.style; // "long"
usedOptions.numeric; // "always"
usedOptions.numberingSystem; // "latn"

Specifications

Browser compatibility

See also