diff --git a/countdown.js b/countdown.js
index c01715b..2b91b59 100644
--- a/countdown.js
+++ b/countdown.js
@@ -1,16 +1,4 @@
/*
-1000 days = 86,400,000,000 ms
-2 years (730.5 days) = 63,115,200,000 ms
-1 year (365.25 days) = 31,557,600,000 ms
-1 year (365 days) = 31,536,000,000 ms
-1 month = 365 / 12 = 30.417 days = 2,628,000,000 ms
-100 hours = 4d 4h = 360,000,000 ms
-1 day = 86,400,000 ms
-100 mins = 1h 40m = 6,000,000 ms
-1 hour = 3,600,000 ms
-1 minute = 60,000 ms
-1 second = 1,000 ms
-
----- ENGLISH -----
Parameters:
goal parameter must be in YYYY-MM-DDTHH:ii:ssZ format (YYYY for year, MM for month, DD for day, HH for hours, ii for minutes and ss for seconds. "T" and "Z" must be left as is. Example: "2022-07-04T14:43:58Z" for July 4th, 2022 at 2:43:58 PM UTC)
@@ -36,31 +24,38 @@ Utilisation :
Mettez l'identifiant de l'élément que vous souhaitez transformer en compte à rebours sur un identifiant relié à un compteur.
*/
+var year = 31556952000; //1 year = 365.2425 days = 31,556,952,000 ms
+var month = year/12; //1 month = 30.436875 days = 2,629,746,000 ms
+var day = 86400000; //1 day = 86,400,000 ms
+var hour = day/24; //1 hour = 3,600,000 ms
+var minute = hour/60; //1 minute = 60,000 ms
+var second = minute/60; //1 second = 1,000 ms
+
function countdownTo(goal, formatBefore = "%countdown", formatAfter = "", id = "countdown"){
var nowDate = new Date();
var goalDate = new Date(goal);
var gap = Math.abs(goalDate - nowDate);
//Formatting count
- if(gap>=63115200000){ //if more than 2 years
- var countString = Math.floor(gap/31557600000)+" ans";
+ if(gap>=2*year){ //if more than 2 years
+ var countString = Math.floor(gap/year)+" ans";
}
- if(gap<63115200000 && gap>=31536000000){ //if between 1 and 2 years
- var countString = Math.floor(gap/31557600000)+" an";
+ if(gap<2*year && gap>=year){ //if between 1 and 2 years
+ var countString = Math.floor(gap/year)+" an";
}
- if(gap<31536000000 && gap>=2628000000){ //if between 1 month and 1 year
- var countString = Math.floor(gap/2628000000)+" mois";
+ if(gap
v1.1 (mai 2023) par MarioSwitch
v2.0 (actuelle, juin 2023) par MarioSwitch
-Version 2.0.56 du 15 mai 2024
+Version 2.0.57 du 31 mai 2024
Vous êtes " . displayOrdinal($myRank) . " sur " . displayInt($accounts) . " (top " . displayFloat($myTop) . " %).
"; + echo "Vous êtes " . displayOrdinal($myRank) . " sur " . displayInt($accounts) . " (top " . displayFloat($myTop) . " %).
"; }else{ echo "Total : " . displayInt($accounts) . " utilisateurs
"; } @@ -30,7 +30,7 @@ $user = $classement[$i]["username"]; $points = $classement[$i]["points"]; $rank = intSQL("SELECT COUNT(*) FROM `users` WHERE `points` > " . $points . ";") + 1; - echo "Fin des votes " . $prediEnd . " UTC
"); if($prediAnswered != NULL){ echo("Réponse donnée " . $prediAnswered . " UTC
"); -}else if($mode == "waitingAnswer"){ - echo("En attente de réponse...
"); +}else if($prediEnd < stringSQL("SELECT NOW();")){ + echo("En attente de réponse…
"); } echo("