From 1a844e943b03013351395511ae0c73a37081725f Mon Sep 17 00:00:00 2001 From: Juan Vásquez Date: Thu, 3 Feb 2022 20:17:46 -0600 Subject: Dischariging Time [es] (#3971) * Dischariging Time [es] Related #3927 number 4 * Add cw118 suggestions * Add el subtitulo Resultado * Update files/es/web/api/batterymanager/dischargingtime/index.md Co-authored-by: Sergio.valera <67393791+sergiogval@users.noreply.github.com> Co-authored-by: Sergio.valera <67393791+sergiogval@users.noreply.github.com> --- .../api/batterymanager/dischargingtime/index.html | 29 --------- .../api/batterymanager/dischargingtime/index.md | 70 ++++++++++++++++++++++ 2 files changed, 70 insertions(+), 29 deletions(-) delete mode 100644 files/es/web/api/batterymanager/dischargingtime/index.html create mode 100644 files/es/web/api/batterymanager/dischargingtime/index.md (limited to 'files/es/web/api') diff --git a/files/es/web/api/batterymanager/dischargingtime/index.html b/files/es/web/api/batterymanager/dischargingtime/index.html deleted file mode 100644 index 4cc79f0b9d..0000000000 --- a/files/es/web/api/batterymanager/dischargingtime/index.html +++ /dev/null @@ -1,29 +0,0 @@ ---- -title: BatteryManager.dischargingTime -slug: Web/API/BatteryManager/dischargingTime -tags: - - API - - Apps - - Batería - - Battery - - Firefox OS - - Gecko DOM Reference - - WebAPI - - aplicaciones -translation_of: Web/API/BatteryManager/dischargingTime ---- -

{{ ApiRef() }}

-

Resumen

-

Indíca la cantidad de tiempo, en segundos, que restan antes de que la batería se descargue completamente.

-

Sintaxis

-
var time = navigator.battery.dischargingTime
-

Valor de retorno, time es el tiempo restante en segundos antes que la batería esté completamente descargada y el sistema se suspenda. Este valor es Infinity si la batería se está cargando en vez de descargando, o si el sistema es incapaz de calcular el tiempo de descarga (o si no hay batería)

-

Specifications

-

{{page("/en-US/docs/Web/API/BatteryManager","Specifications")}}

-

Browser compatibility

-

{{page("/en-US/docs/Web/API/BatteryManager","Browser_compatibility")}}

-

See also

- diff --git a/files/es/web/api/batterymanager/dischargingtime/index.md b/files/es/web/api/batterymanager/dischargingtime/index.md new file mode 100644 index 0000000000..f9534a5fd3 --- /dev/null +++ b/files/es/web/api/batterymanager/dischargingtime/index.md @@ -0,0 +1,70 @@ +--- +title: BatteryManager.dischargingTime +slug: Web/API/BatteryManager/dischargingTime +tags: + - API + - Apps + - Batería + - Battery + - Firefox OS + - Gecko DOM Reference + - WebAPI + - aplicaciones +translation_of: Web/API/BatteryManager/dischargingTime +browser-compat: api.BatteryManager.dischargingTime +--- +{{deprecated_header}}{{APIRef("Battery API")}} + +Indíca la cantidad de tiempo, en segundos, +que restan antes de que la batería se descargue completamente. + +> **Nota:** Incluso si el tiempo devuelto es exacto al segundo, los navegadores los redondean a un intervalo más alto (típicamente a los 15 minutos más cercanos) por razones de privacidad. + +## Sintaxis + +```js +var time = battery.dischargingTime; +``` + +Valor de retorno, `time` es el tiempo restante en segundos antes que la `battery`, +que es un objeto {{domxref("BatteryManager")}}, +esté completamente descargada y el sistema se suspenda. +Este valor es [`Infinity`](/es/docs/Web/JavaScript/Reference/Global_Objects/Infinity) +Si la batería se está cargando en vez de descargando, +o si el sistema es incapaz de calcular el tiempo de descarga. + +## Ejemplo + +### Contenido HTML + +```html +
(tiempo de descarga desconocido)
+``` + +### Contenido JavaScript + +```js +navigator.getBattery().then(function(battery) { + var time = battery.dischargingTime; + + document.querySelector("#dischargingTime").textContent = battery.dischargingTime; +}); +``` + +### Resultado + +{{EmbedLiveSample('', '100%', 30)}} + +## Especificaciones + +{{Specifications}} + +## Compatibilidad del navegador + +{{Compat}} + +## Ver también + +- {{domxref("BatteryManager")}} +- {{domxref("Navigator.getBattery")}} + -- cgit v1.2.3-54-g00ecf