King Kong
King Kong

Reputation: 2915

countdown is not working jquery

I am using Countdown Plugin. I am trying to set a countdown say : Since 06/17/2012 Until 06/18/2012 . For this i tried :

 var start = new Date(2012, 06 - 1, 17);
 var  end = new Date(2012, 06 - 1, 18);

 $('div').countdown({ since: start, until: end });

But it shows all ( Hours , Mins, Secs ) ( 0 0 0). What i am doing wrong?

EDIT

It was just a typing mistake but i used new Date(year , month , Date) in my code.

Upvotes: 0

Views: 1247

Answers (3)

Tats_innit
Tats_innit

Reputation: 34107

Working Demo http://jsfiddle.net/cUW4M/16/ or http://jsfiddle.net/cUW4M/15/

Please see my previous reply here: jQuery Countdown Plugin - only show non-zero periods

Hope this helps,

Script

<script type="text/javascript" src="http://keith-wood.name/js/jquery.countdown.js"></script>

code

var start = new Date(2012, 06 - 1, 17);
 var  end = new Date(2012, 06 - 1, 18);

 $('div').countdown({since: start, until: end }); //until: 0 to get zeros

​

Upvotes: 1

Subhajit
Subhajit

Reputation: 1987

The variable name end is creating the problem, please change it to something like the below code :-

  var start = new Date(17, 06 - 1, 2012);
  var  endDate = new Date(18, 06 - 1, 2012);

  $('div').countdown({ since: start, until: endDate });

Upvotes: 1

Amberlamps
Amberlamps

Reputation: 40448

The Date object works like:

new Date(year, month, day);

Upvotes: 2

Related Questions