Skip to content

Commit

Permalink
Arreglado el contador en los minutos y segundos
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubén León committed Mar 10, 2022
1 parent fe4c002 commit 5222ab3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ <h3 class="h4-propio">
endtimeMinutes: minutos,
endtimeSeconds: segundos,
timeZone: ""
// ex: timeZone: "America/New_York"
// ex: timeZone: "Europe/Madrid"
//go to " http://momentjs.com/timezone/ " to get timezone
});
</script>
Expand Down
13 changes: 6 additions & 7 deletions vendor/countdowntime/countdowntime.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,13 @@
var endMinutes = options.endtimeMinutes;
var endSeconds = options.endtimeSeconds;

if(tZ == "") {
var deadline = new Date(endYear, endMonth - 1, endDate, endHours, endMinutes, endSeconds);
}
else {
var deadline = moment.tz([endYear, endMonth - 1, endDate, endHours, endMinutes, endSeconds], tZ).format();
}

var deadline = new Date(endDate, endHours, endMinutes, endSeconds);



if(Date.parse(deadline) < Date.parse(timeNow)) {
var deadline = new Date(Date.parse(new Date()) + endDate * 24 * 60 * 60 * 1000 + endHours * 60 * 60 * 1000);
var deadline = new Date(Date.parse(new Date()) + endDate * 24 * 60 * 60 * 1000 + endHours * 60 * 60 * 1000 + endMinutes * 60 * 1000 + endSeconds * 1000);
}


Expand All @@ -48,6 +46,7 @@
var minutes = Math.floor((t / 1000 / 60) % 60);
var hours = Math.floor((t / (1000 * 60 * 60)) % 24);
var days = Math.floor(t / (1000 * 60 * 60 * 24));
//console.log("minutos: ",minutes)
return {
'total': t,
'days': days,
Expand Down

0 comments on commit 5222ab3

Please sign in to comment.