1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
---
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
---
<div>{{JSRef}}</div>
<p>La propriété <strong><code>Intl.RelativeTimeFormat.prototype</code></strong> représente l'objet prototype utilisé par le constructeur {{jsxref("RelativeTimeFormat", "Intl.RelativeTimeFormat")}}.</p>
<p>{{js_property_attributes(0, 0, 0)}}</p>
<h2 id="Description">Description</h2>
<p>Voir {{jsxref("RelativeTimeFormat")}} pour une description des instances <code>Intl.RelativeTimeFormat</code>.</p>
<p>Les instances {{jsxref("RelativeTimeFormat", "Intl.RelativeTimeFormat")}} héritent de <code>Intl.RelativeTimeFormat.prototype</code>. Les modifications apportées au prototype seront héritées par l'ensemble des instances {{jsxref("RelativeTimeFormat", "Intl.RelativeTimeFormat")}}.</p>
<h2 id="Propriétés">Propriétés</h2>
<dl>
<dt><code>Intl.<font face="consolas, Liberation Mono, courier, monospace">RelativeTimeFormat</font>.prototype.constructor</code></dt>
<dd>Une référence à <a href="/fr/docs/Web/JavaScript/Reference/Global_Objects/Intl.RelativeTimeFormat" title="The Intl.DateTimeFormat object is a constructor for objects that enable language-sensitive date and time formatting."><code>Intl.RelativeTimeFormat</code></a>.</dd>
</dl>
<h2 id="Méthodes">Méthodes</h2>
<dl>
<dt>{{jsxref("RelativeTimeFormat.format", "Intl.RelativeTimeFormat.prototype.format()")}}</dt>
<dd>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 <a href="/fr/docs/Web/JavaScript/Reference/Global_Objects/Intl.RelativeTimeFormat" title="The Intl.DateTimeFormat object is a constructor for objects that enable language-sensitive date and time formatting."><code>Intl.RelativeTimeFormat</code></a>.</dd>
<dt>{{jsxref("RelativeTimeFormat.formatToParts", "Intl.RelativeTimeFormat.prototype.formatToParts()")}}</dt>
<dd>Une méthode qui formate une valeur comme la méthode <code>format()</code> mais qui renvoie un tableau ({{jsxref("Array")}}) contenant les différentes parties de la valeur formatée.</dd>
<dt>{{jsxref("RelativeTimeFormat.resolvedOptions", "Intl.RelativeTimeFormat.prototype.resolvedOptions()")}}</dt>
<dd>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.</dd>
</dl>
<h2 id="Spécifications">Spécifications</h2>
<table class="standard-table">
<thead>
<tr>
<th scope="col">Spécification</th>
<th scope="col">État</th>
<th scope="col">Commentaires</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="https://tc39.github.io/proposal-intl-relative-time/#sec-Intl.RelativeTimeFormat.prototype">Proposition pour <code>Intl.RelativeTime</code></a></td>
<td>Proposition de niveau 3</td>
<td> </td>
</tr>
</tbody>
</table>
<h2 id="Compatibilité_des_navigateurs">Compatibilité des navigateurs</h2>
<p>{{Compat("javascript.builtins.Intl.RelativeTimeFormat.prototype")}}</p>
<h2 id="Voir_aussi">Voir aussi</h2>
<ul>
<li>{{jsxref("RelativeTimeFormat", "Intl.RelativeTimeFormat")}}</li>
</ul>
|