<div class="good__timer timer js-timer" data-date="[0,0,0,0,5]"></div>
let finalDate = $timer.data('date');
timer.start({countdown: true, startValues: finalDate})
<div class="timer">
<p class="countdown-timer" data-d="7" data-h="16" data-i="43" data-s="51">
<span>
<i class="countdown-days">7</i>
<span>days</span>
</span>
<span>
<i class="countdown-hours">16</i>
<span>hrs</span>
</span>
<span>
<i class="countdown-mins">40</i>
<span>min</span>
</span>
<span>
<i class="countdown-secs">38</i>
<span>sec</span>
</span>
</p>
</div>
var timers = {};
$('.countdown-timer').each(function (index, timer) {
timers[index] = new easytimer.Timer();
timers[index].start(
{
countdown: true,
startValues: {
seconds: $(timer).data('s'),
minutes: $(timer).data('i'),
hours: $(timer).data('h'),
days: $(timer).data('d'),
}
});
timers[index].addEventListener('secondsUpdated', function (e) {
$(timer).find('.countdown-days').html(timers[index].getTimeValues().days);
$(timer).find('.countdown-hours').html(timers[index].getTimeValues().hours);
$(timer).find('.countdown-mins').html(timers[index].getTimeValues().minutes);
$(timer).find('.countdown-secs').html(timers[index].getTimeValues().seconds);
});
timers[index].addEventListener('targetAchieved', function (e) {
$(timer).html('EXPIRED');
});
});