Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function GetClock(registrantCount) {
- var now = new Date().getTime();
- var unlinkDate = new Date((1498921200 + 1728 * (31000 - registrantCount)) * 1000).getTime();
- var distance = unlinkDate - now;
- var days = Math.floor(distance / (1000 * 60 * 60 * 24));
- var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
- var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
- var seconds = Math.floor((distance % (1000 * 60)) / 1000);
- if (minutes < 10) {
- minutes = "0" + minutes;
- }
- if (seconds < 10) {
- seconds = "0" + seconds;
- }
- if (distance >= 0) {
- return days + "<span class='label'> days </span>" + hours + ":" + minutes + ":" + seconds;
- } else {
- return "???";
- }
- }
- function GetSlotsLeft(registrantCount) {
- var now = new Date().getTime();
- var unlinkDate = new Date((1498921200 + 1728 * (31000 - registrantCount)) * 1000).getTime();
- var distance = unlinkDate - now;
- var slotsLeft = Math.floor((distance / 1000) / 1728);
- return slotsLeft;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement