2
I’m running a countdown system and I’m using "The Final Countdown jQuery"
$('#clock').countdown('2015/02/16', function(event) {
$(this).html(event.strftime('%D dias %H:%M:%S'));
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="http://mindvelopers.com/jquery.countdown.min.js"></script>
<div id="clock"></div>
My problem is that I need to add +21 hours to each event (to the result), but I cannot add the way this function is done.
It’s actually not working properly on that code. The date this for 2015/02/15, and the result is saying 6 days ... and also not counting down.
– user3465632
That’s exactly what I wanted! Perfect. Thanks for your help!
– user3465632
@Guilhermenascimento +1. Because you
split
to create the date?– stderr
Why did I use the
split
to create the date instead ofnew Date(2015, 2, 15)
? For two reasons, first to facilitate the user’s adaptation regarding the use of the format0000/00/00
and whynew Date(2015, 2, 15)
would be equal to "15 March 2015" (the correct is February, therefore 2 should have a -1), something else in some browsers/engines to pass direct string as you did in your examplenew Date ('2015/02/16');
is not a pattern ofISO
. Thanks for asking :)– Guilherme Nascimento
@Guilhermenascimento Thanks for the comment =D. I tried to do what you said and the result came out a little different from what is in the answers. See here. Would the output of this example not be correct?
– stderr
@Qmechanic73 The examples were very good, but they are still more complex for users with less experience to understand. But deserves +1, mainly by example with ISO :)
– Guilherme Nascimento