-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert /web/javascript/reference/global_objects/date folder to Markd…
…own (es) (#8168) * Convert /web/javascript/reference/global_objects/date folder to Markdown (es) * Apply suggestions from code review Original PR by: Queen Vinyl Da.i'gyu-Kazotetsu <[email protected]> Co-authored-by: GrayWolf <[email protected]>
- Loading branch information
Showing
40 changed files
with
1,344 additions
and
1,680 deletions.
There are no files selected for viewing
72 changes: 0 additions & 72 deletions
72
files/es/web/javascript/reference/global_objects/date/getdate/index.html
This file was deleted.
Oops, something went wrong.
52 changes: 52 additions & 0 deletions
52
files/es/web/javascript/reference/global_objects/date/getdate/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
--- | ||
title: Date.prototype.getDate() | ||
slug: Web/JavaScript/Reference/Global_Objects/Date/getDate | ||
translation_of: Web/JavaScript/Reference/Global_Objects/Date/getDate | ||
original_slug: Web/JavaScript/Referencia/Objetos_globales/Date/getDate | ||
--- | ||
{{JSRef}} | ||
|
||
El método **`getDate()`** devuelve el día del mes para la fecha especificada de acuerdo con la hora local. | ||
|
||
## Sintaxis | ||
|
||
dateObj.getDate() | ||
|
||
### Parámetros | ||
|
||
Ninguno. | ||
|
||
### Valor de retorno | ||
|
||
El valor devuelto por `getDate() es u`n número entero, entre 1 y 31, que representa el día del mes para la fecha dada según la hora local. | ||
|
||
## Ejemplos | ||
|
||
### Uso de `getDate()` | ||
|
||
La segunda instrucción asigna el valor 25 a la variable `day`, en función del valor del objeto {{jsxref("Date")}} `Xmas95`. | ||
|
||
```js | ||
var Xmas95 = new Date('December 25, 1995 23:15:30'); | ||
var day = Xmas95.getDate(); | ||
|
||
console.log(day); // 25 | ||
``` | ||
|
||
## Especificaciones | ||
|
||
| Especificación | Estado | Comentario | | ||
| ---------------------------------------------------------------------------------------------------- | ------------------------ | ------------------------------------------------- | | ||
| {{SpecName('ES6', '#sec-date.prototype.getdate', 'Date.prototype.getDate')}} | {{Spec2('ES6')}} | | | ||
| {{SpecName('ES5.1', '#sec-15.9.5.14', 'Date.prototype.getDate')}} | {{Spec2('ES5.1')}} | | | ||
| {{SpecName('ES1')}} | {{Spec2('ES1')}} | Definición inicial. Implantado en JavaScript 1.1. | | ||
|
||
## Compatibilidad con navegadores | ||
|
||
{{Compat("javascript.builtins.Date.getDate")}} | ||
|
||
## Véase también | ||
|
||
- {{jsxref("Date.prototype.getUTCDate()")}} | ||
- {{jsxref("Date.prototype.getUTCDay()")}} | ||
- {{jsxref("Date.prototype.setDate()")}} |
77 changes: 0 additions & 77 deletions
77
files/es/web/javascript/reference/global_objects/date/getday/index.html
This file was deleted.
Oops, something went wrong.
57 changes: 57 additions & 0 deletions
57
files/es/web/javascript/reference/global_objects/date/getday/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
title: Date.prototype.getDay() | ||
slug: Web/JavaScript/Reference/Global_Objects/Date/getDay | ||
tags: | ||
- Date | ||
- JavaScript | ||
- Prototype | ||
- metodo | ||
translation_of: Web/JavaScript/Reference/Global_Objects/Date/getDay | ||
original_slug: Web/JavaScript/Referencia/Objetos_globales/Date/getDay | ||
--- | ||
{{JSRef}} | ||
|
||
`El método `**`getDay()`** devuelve el día de la semana de la fecha especificada en función de la fecha local; siendo 0 (Domingo) el primer día. | ||
|
||
## Sintaxis | ||
|
||
dateObj.getDay() | ||
|
||
### Parámetros | ||
|
||
Ninguno. | ||
|
||
### Valor devuelto | ||
|
||
El valor devuelto por `getDay()` es un entero correspondiente al día de la semana; siendo 0 (Domingo) el primer día, 1 (Lunes) el segundo, etcétera. | ||
|
||
## Ejemplos | ||
|
||
### `Usos de getDay()` | ||
|
||
La segunda sentencia asigna el valor 1 a `weekday, `basado en el valor del objeto Xmas95 {{jsxref("Date")}}. December 25, 1995, que corresponde a Lunes. | ||
|
||
```js | ||
var Xmas95 = new Date('December 25, 1995 23:15:30'); | ||
var weekday = Xmas95.getDay(); | ||
|
||
console.log(weekday); // 1 | ||
``` | ||
|
||
## Especificaciones | ||
|
||
| Especificación | Estado | Comentario | | ||
| ---------------------------------------------------------------------------------------------------- | ------------------------ | ------------------------------------------- | | ||
| {{SpecName('ES6', '#sec-date.prototype.getday', 'Date.prototype.getDay')}} | {{Spec2('ES6')}} | | | ||
| {{SpecName('ES5.1', '#sec-15.9.5.16', 'Date.prototype.getDay')}} | {{Spec2('ES5.1')}} | | | ||
| {{SpecName('ES1')}} | {{Spec2('ES1')}} | Definición inicial. Implementado en JS 1.0. | | ||
|
||
## Compatibilidad con navegadores | ||
|
||
{{Compat("javascript.builtins.Date.getDay")}} | ||
|
||
## Ver también | ||
|
||
- {{jsxref("Date.prototype.getUTCDate()")}} | ||
- {{jsxref("Date.prototype.getUTCDay()")}} | ||
- {{jsxref("Date.prototype.setDate()")}} |
68 changes: 0 additions & 68 deletions
68
files/es/web/javascript/reference/global_objects/date/getfullyear/index.html
This file was deleted.
Oops, something went wrong.
58 changes: 58 additions & 0 deletions
58
files/es/web/javascript/reference/global_objects/date/getfullyear/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
title: Date.prototype.getFullYear() | ||
slug: Web/JavaScript/Reference/Global_Objects/Date/getFullYear | ||
tags: | ||
- Fecha | ||
- JavaScript | ||
- Prototipo | ||
- Referencia | ||
- metodo | ||
translation_of: Web/JavaScript/Reference/Global_Objects/Date/getFullYear | ||
original_slug: Web/JavaScript/Referencia/Objetos_globales/Date/getFullYear | ||
--- | ||
{{JSRef}} | ||
|
||
El método **`getFullYear()`** devuelve el año de la fecha indicada acorde a la hora local. | ||
|
||
Usa este método en lugar del método {{jsxref("Date.prototype.getYear()", "getYear()")}}. | ||
|
||
{{EmbedInteractiveExample("pages/js/date-getfullyear.html","shorter")}} | ||
|
||
## Sintaxis | ||
|
||
dateObj.getFullYear() | ||
|
||
### Valor devuelto | ||
|
||
Un número correspondiente al año de la fecha indicada, según la hora local. | ||
|
||
## Descripción | ||
|
||
El valor devuelto por `getFullYear()` es un número absoluto. Para fechas entre los años 1000 y 9999, `getFullYear()` devuelve un número de cuatro cifras, por ejemplo, 1995. Utiliza esta función para obtener un año que cumpla con los años posteriores al 2000. | ||
|
||
## Ejemplos | ||
|
||
### Utilizando getFullYear() | ||
|
||
El siguiente ejemplo asigna el valor de cuatro dígitos del año actual a la variable `year`. | ||
|
||
```js | ||
var today = new Date(); | ||
var year = today.getFullYear(); | ||
``` | ||
|
||
## Especificaciones | ||
|
||
| Especificación | | ||
| -------------------------------------------------------------------------------------------------------------------- | | ||
| {{SpecName('ESDraft', '#sec-date.prototype.getfullyear', 'Date.prototype.getFullYear')}} | | ||
|
||
## Compatibilidad con navegadores | ||
|
||
{{Compat("javascript.builtins.Date.getFullYear")}} | ||
|
||
## Ver también | ||
|
||
- {{jsxref("Date.prototype.getUTCFullYear()")}} | ||
- {{jsxref("Date.prototype.setFullYear()")}} | ||
- {{jsxref("Date.prototype.getYear()")}} |
Oops, something went wrong.