views:

383

answers:

1

I'm using the jQuery Countdown plugin but having some trouble getting it to show the right countdown.

I want to countdown to a date and a time, but everytime I add the time to the Date string, it stops working.

This works:

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

But this doesn't:

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

All I get is NaN's instead of numbers. Am I passing in the time wrong? Or is there another way I should pass in the date?

A: 

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

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

or as a comma delimited list of parameters, like this:

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

In your example you're mixing both approaches.

Robban
Thank you - you have no idea how much time I spent looking for that today!! Works like a charm!
Les