I'm trying to implement Keith Wood Countdown on a web page with this code, placed just before end body tag :
$(function(){
var untilDate = new Date(2016,4,4,8,0);
console.log(untilDate.getFullYear() + "-" + untilDate.getMonth() + "-" + untilDate.getDate());
$("#next-departure").countdown($.countdown.regionalOptions["fr"]);
$("#next-departure").countdown(
{
until:untilDate,
format:'yowdHMS'
}
);
});
No errors in the console and the date is correct but... always display : No countdown running
Any idea on what i'm missing ?
The countdown displays 0 because it is created with empty parameters, with the code:
$("#next-departure").countdown($.countdown.regionalOptions["fr"]);
The following lines of code, in which you specify the proper parameters, will not recreate the countdown.
My solution is to include the file jquery.countdown-fr.js
for the regional settings, right after the jquery.countdown.js
file:
<script type="text/javascript" src="jquery.countdown-fr.js"></script>
You can find this file here: https://github.com/kbwood/countdown/blob/master/jquery.countdown-fr.js.
Then, create the countdown with the following code:
$(function(){
var untilDate = new Date(2016,4,4,8,0);
$("#next-departure").countdown({
until:untilDate,
format:'YOWDHMS'
});
});
Fiddle here: https://jsfiddle.net/cu246mh2/.