вот метод countdown_start ()
start_countdown() {
let self = this;
this.processedMatches.forEach(m => {
let effThis = $(`#span_${m.raceId}`);
let type = effThis.attr("data-raceaType");
if (type !== "POST") {
let nextRace = effThis.attr("data-time");
let raceId = effThis.attr("data-race-id");
let nextYear = moment.tz(nextRace, "GMT+0");
let inst = effThis.countdown(nextYear.toDate())
.on('update.countdown',
function (event) {
let displayDate = event.strftime('%D:%H:%M:%S');
effThis.html(event.strftime(
self.getDisplayFormat(displayDate, effThis))); //'%H:%M:%S'
})
.on('finish.countdown',
function () {
//effThis.html("");
console.log(`count down finished ${raceId}`);
self.slide_carousel();
});
self.countdownInstance.push(inst);
//self.countdownInstance.push(raceId);
}
});
this.countdown_started = true;
}
и это clear_countdown ()
clear_countdown() {
//this.countdownInstance = [];
this.countdownInstance.forEach(inst => {
inst.countdown('remove');
});
//this.countdownInstance = [];
//$('.countSpanMatchUp').countdown('remove');
}