How do I countdown to a start time and then countdown to a stop time, using this countdown library?
The documentation says I should add a parameter onExpiry to run a callback function but no matter how I structure these functions, it either starts counting down to stopdate even when startdate is still in the future or it stops at 00:00:00:00 and does nothing on the expiry of startdate.
What I need it to do is countdown to startdate and when done, countdown to stopdate
function startTimers() {
$(function() {
$('#auction-counter').countdown({
until: startdate,
onExpiry: stopTimer,
format: 'DHMS',
padZeroes: true,
alwaysExpire: true
});
function stopTimer() {
$('#auction-counter').countdown({
until: stopdate,
format: 'DHMS',
padZeroes: true,
alwaysExpire: true
});
}
});
}
The code above does countdown to startdate but then stops at 00:00:00:00