diff options
Diffstat (limited to 'files/ca/web/javascript/reference/global_objects/date/setyear/index.html')
| -rw-r--r-- | files/ca/web/javascript/reference/global_objects/date/setyear/index.html | 125 |
1 files changed, 0 insertions, 125 deletions
diff --git a/files/ca/web/javascript/reference/global_objects/date/setyear/index.html b/files/ca/web/javascript/reference/global_objects/date/setyear/index.html deleted file mode 100644 index f2e0a31ad2..0000000000 --- a/files/ca/web/javascript/reference/global_objects/date/setyear/index.html +++ /dev/null @@ -1,125 +0,0 @@ ---- -title: Date.prototype.setYear() -slug: Web/JavaScript/Reference/Global_Objects/Date/setYear -translation_of: Web/JavaScript/Reference/Global_Objects/Date/setYear -original_slug: Web/JavaScript/Referencia/Objectes_globals/Date/setYear ---- -<div>{{JSRef}} {{deprecated_header}}</div> - -<p>El mètode <strong><code>setYear()</code></strong> assigna l'any per a una data especificada, d'acord a l'hora local. Com que <code>setYear()</code> no utilitza anys complerts ("el problema de l'any 2000"), aquest mètode està en desús i s'ha reemplaçat pel mètode {{jsxref("Date.prototype.setFullYear()", "setFullYear()")}}.</p> - -<h2 id="Sintaxi">Sintaxi</h2> - -<pre class="syntaxbox"><code><var>objecteData</var>.setYear(any)</code></pre> - -<h3 id="Paràmetres">Paràmetres</h3> - -<dl> - <dt><code>any</code></dt> - <dd>Un nombre sencer.</dd> -</dl> - -<h2 id="Descripció">Descripció</h2> - -<p>Si <code>any</code> és un nombre entre 0 i 99 (inclòs), llavors s'assigna <code>1900 + any</code> a <code>objecteData</code>. En cas contrari, s'assigna <code>any</code> a <code>objecteData</code>.</p> - -<h2 id="Exemples">Exemples</h2> - -<h3 id="Utilitzar_setYear()">Utilitzar <code>setYear()</code></h3> - -<p>Les dues primeres línies assignen el valor 1996 a l'any. La tercera línia assigna el valor 2000 a l'any.</p> - -<pre class="brush: js">var elGranDia = new Date(); - -elGranDia.setYear(96); -elGranDia.setYear(1996); -elGranDia.setYear(2000); -</pre> - -<h2 id="Especificacions">Especificacions</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">Especificació</th> - <th scope="col">Estat</th> - <th scope="col">Comentaris</th> - </tr> - <tr> - <td>{{SpecName('ES1')}}</td> - <td>{{Spec2('ES1')}}</td> - <td>Definició inicial. Implementat a JavaScript 1.0.</td> - </tr> - <tr> - <td>{{SpecName('ES5.1', '#sec-B.2.5', 'Date.prototype.getYear')}}</td> - <td>{{Spec2('ES5.1')}}</td> - <td>Definit a l'annex de compatibilitat (informatiu).</td> - </tr> - <tr> - <td>{{SpecName('ES6', '#sec-date.prototype.setyear', 'Date.prototype.getYear')}}</td> - <td>{{Spec2('ES6')}}</td> - <td>Definit a l'annex de característiques adicionals per a navegadors web (normatiu).</td> - </tr> - </tbody> -</table> - -<h2 id="Compatibilitat_amb_navegadors">Compatibilitat amb navegadors</h2> - -<div>{{CompatibilityTable}}</div> - -<div id="compat-desktop"> -<table class="compat-table"> - <tbody> - <tr> - <th>Característica</th> - <th>Chrome</th> - <th>Firefox (Gecko)</th> - <th>Internet Explorer</th> - <th>Opera</th> - <th>Safari</th> - </tr> - <tr> - <td>Suport bàsic</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - </tr> - </tbody> -</table> -</div> - -<div id="compat-mobile"> -<table class="compat-table"> - <tbody> - <tr> - <th>Característica</th> - <th>Android</th> - <th>Chrome for Android</th> - <th>Firefox Mobile (Gecko)</th> - <th>IE Mobile</th> - <th>Opera Mobile</th> - <th>Safari Mobile</th> - </tr> - <tr> - <td>Suport bàsic</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - <td>{{CompatVersionUnknown}}</td> - </tr> - </tbody> -</table> -</div> - -<h2 id="Vegeu_també">Vegeu també</h2> - -<ul> - <li>{{jsxref("Date.prototype.getFullYear()")}}</li> - <li>{{jsxref("Date.prototype.getUTCFullYear()")}}</li> - <li>{{jsxref("Date.prototype.setFullYear()")}}</li> - <li>{{jsxref("Date.prototype.setUTCFullYear()")}}</li> -</ul> |
