--- title: Intl.RelativeTimeFormat.prototype slug: conflicting/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat tags: - Internationalisation - Intl - JavaScript - Propriété - Prototype - Reference translation_of: Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat translation_of_original: Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/prototype original_slug: Web/JavaScript/Reference/Objets_globaux/Intl/RelativeTimeFormat/prototype ---
{{JSRef}}

La propriété Intl.RelativeTimeFormat.prototype représente l'objet prototype utilisé par le constructeur {{jsxref("RelativeTimeFormat", "Intl.RelativeTimeFormat")}}.

{{js_property_attributes(0, 0, 0)}}

Description

Voir {{jsxref("RelativeTimeFormat")}} pour une description des instances Intl.RelativeTimeFormat.

Les instances {{jsxref("RelativeTimeFormat", "Intl.RelativeTimeFormat")}} héritent de Intl.RelativeTimeFormat.prototype. Les modifications apportées au prototype seront héritées par l'ensemble des instances {{jsxref("RelativeTimeFormat", "Intl.RelativeTimeFormat")}}.

Propriétés

Intl.RelativeTimeFormat.prototype.constructor
Une référence à Intl.RelativeTimeFormat.

Méthodes

{{jsxref("RelativeTimeFormat.format", "Intl.RelativeTimeFormat.prototype.format()")}}
Une méthode qui formate une valeur, accompagnée d'une unité selon des options de locales et de formatage stockées dans l'objet Intl.RelativeTimeFormat.
{{jsxref("RelativeTimeFormat.formatToParts", "Intl.RelativeTimeFormat.prototype.formatToParts()")}}
Une méthode qui formate une valeur comme la méthode format() mais qui renvoie un tableau ({{jsxref("Array")}}) contenant les différentes parties de la valeur formatée.
{{jsxref("RelativeTimeFormat.resolvedOptions", "Intl.RelativeTimeFormat.prototype.resolvedOptions()")}}
Une méthode qui renvoie un objet dont les propriétés indique les options de locale et de formatage calculées lors de l'initialisation du formateur.

Spécifications

Spécification État Commentaires
Proposition pour Intl.RelativeTime Proposition de niveau 3  

Compatibilité des navigateurs

{{Compat("javascript.builtins.Intl.RelativeTimeFormat.prototype")}}

Voir aussi