From 4b1a9203c547c019fc5398082ae19a3f3d4c3efe Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:41:15 -0500 Subject: initial commit --- .../objectes_globals/date/getday/index.html | 121 +++++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 files/ca/web/javascript/referencia/objectes_globals/date/getday/index.html (limited to 'files/ca/web/javascript/referencia/objectes_globals/date/getday') diff --git a/files/ca/web/javascript/referencia/objectes_globals/date/getday/index.html b/files/ca/web/javascript/referencia/objectes_globals/date/getday/index.html new file mode 100644 index 0000000000..244562c167 --- /dev/null +++ b/files/ca/web/javascript/referencia/objectes_globals/date/getday/index.html @@ -0,0 +1,121 @@ +--- +title: Date.prototype.getDay() +slug: Web/JavaScript/Referencia/Objectes_globals/Date/getDay +translation_of: Web/JavaScript/Reference/Global_Objects/Date/getDay +--- +
{{JSRef("Global_Objects", "Date")}}
+ +

Resum

+ +

El mètode getDay() retorna el dia de la setmana per a la data especificada, en temps local on 0 (zero) representa el Diumenge.

+ +

Sintaxi

+ +
dateObj.getDay()
+ +

Paràmetres

+ +

Cap.

+ +

Retorna

+ +

El valor retornat per getDay() és un nombre sencer que correspon al dia de la setmana tal i com es mostra a continuació: 0 és Diumenge, 1 és Dilluns, 2 és Dimarts, etcètera.

+ +

Exemples

+ +

Exemple: Utilitzar getDay()

+ +

La segona sentència que trobareu a continuació asigna el valor 1 a la variable diaSetmana, basat en el valor de l'objecte {{jsxref("Global_Objects/Date", "Date")}} nadal95, que està inicialitzat amb la data d 25 de Desembre de 1995, és un Dilluns.

+ +
var nadal95 = new Date('December 25, 1995 23:15:30');
+var diaSetmana = nadal95.getDay();
+
+console.log(diaSetmana); // 1
+
+ +

Especificacions

+ + + + + + + + + + + + + + + + + + + + + + + + +
EspecificacióEstatComentaris
ECMAScript 1a Edició.StandardDefinició inicial. Implementat a JavaScript 1.0.
{{SpecName('ES5.1', '#sec-15.9.5.16', 'Date.prototype.getDay')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-date.prototype.getday', 'Date.prototype.getDay')}}{{Spec2('ES6')}} 
+ +

Compatibilitat amb navegadors

+ +
{{CompatibilityTable}}
+ +
+ + + + + + + + + + + + + + + + + + + +
CaracterísticaChromeFirefox (Gecko)Internet ExplorerOperaSafari
Suport bàsic{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +
+ + + + + + + + + + + + + + + + + + + + + +
CaracterísticaAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Suport bàsic{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
+
+ +

Vegeu també

+ + -- cgit v1.2.3-54-g00ecf