Closed nicmare closed 3 years ago
Because getDays()
doesn't exist on Date object, it's getDate()
: )
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getDate
Maybe use this template instead? https://pqina.nl/flip/preset-event-countdown.html
i finally managed to build a nice appealing countdown. visually its perfect for my needs. but i am not sure if the code is correct. have the feeling it needs some optimization. What do you think? https://tvim.de/cheil/countdown/v3/billboard.html this is the code behind:
Tick.count.down('').onupdate = function () {
var d = Tick.helper.date();
tick.value = {
days: 16 - d.getDate(),
hours: 24 - d.getHours(),
minutes: 60 - d.getMinutes(),
seconds: 60 - d.getSeconds()
};
};
I'll close the issue.
I'm not sure what you're trying to do there, again, I advise to look at the countdown example.
thank you
Hi @rikschennink ! Tried to adapt your code to include days. Your code:
my code:
but then i get Uncaught TypeError: d.getDays is not a function. why does it not work?