0

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.

King Kong
  • 2,855
  • 5
  • 28
  • 39

3 Answers3

2

The Date object works like:

new Date(year, month, day);
Amberlamps
  • 39,180
  • 5
  • 43
  • 53
1

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 });
Subhajit
  • 1,929
  • 3
  • 19
  • 21
1

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

​
Community
  • 1
  • 1
Tats_innit
  • 33,991
  • 10
  • 71
  • 77