JQuery countdown plugin does not accept time as well as date

I use the jQuery Countdown plugin , but some problems getting it to show the correct countdown.

I want a countdown of time and time, but every time I add time to a Date string, it stops working.

It works:

var openTime = new Date('2009,09,25'); $('#countdown').countdown({until: openTime}); 

But this is not so:

 var openTime = new Date('2009,09,25,08,00'); $('#countdown').countdown({until: openTime}); 

All I get is NaN instead of numbers. Am I really wrong? Or is there another way I had to go through the date?

+4
source share
1 answer

I believe that you should pass it either as a date string, like this:

 var date = new Date ( 'January 1, 2009 12:15:10' ); 

or as a list of parameters, separated by commas, for example:

 var date = new Date ( 2009, 0, 1, 12, 15, 0 ); 

In your example, you are mixing both approaches.

+4
source

All Articles