Skip to content

Commit

Permalink
update countdown
Browse files Browse the repository at this point in the history
  • Loading branch information
elbob-mx committed Jun 4, 2024
1 parent 44b52af commit fd19c00
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ <h2 id="mes" class="text-2xl laptop:text-6xl">0</h2>
<div class="hidden laptop:text-4xl laptop:inline-block"></div>

<div class="p-1 rounded-md laptop:p-6 ">
<h2 id="dia" class="text-2xl laptop:text-6xl">0</h2>
<h2 id="dias" class="text-2xl laptop:text-6xl">0</h2>
<p class="text-sm laptop:text-lg">días</p>
</div>

Expand Down
6 changes: 3 additions & 3 deletions js/contador.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
var cuentaRegresiva = new Date("August 17, 2024 00:00").getTime();
let mesesContador = document.getElementById("mes");
let diasContador = document.getElementById("dia");
let diasContador = document.getElementById("dias");
let horasContador = document.getElementById("hora");
let minutosContador = document.getElementById("minuto");
let segundosContador = document.getElementById("segundo");
Expand All @@ -11,8 +11,8 @@ let x = setInterval(function () {

let intervalo = cuentaRegresiva - hoy;

let meses = Math.floor(intervalo / (1000 * 60 * 60 * 24 * 30));
let dias = 30 % Math.floor(intervalo / (1000 * 60 * 60 * 24));
let meses = Math.floor(intervalo / (1000 * 60 * 60 * 24 * 30.437));
let dias = Math.floor(intervalo / (1000 * 60 * 60 * 24 * 30.437));
let horas = Math.floor((intervalo % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
let minutos = Math.floor((intervalo % (1000 * 60 * 60)) / (1000 * 60));
let segundos = Math.floor((intervalo % (1000 * 60)) / 1000);
Expand Down

0 comments on commit fd19c00

Please sign in to comment.