displayEventCountdown(id, duration) {
    const currentEvent = document.querySelector(`[data-identity="${id}"] span`);
    let eventDuration = duration - 1;
    const eventInterval = setInterval(() => {
      currentEvent.innerHTML = eventDuration;
      eventDuration -= 1;
    }, 1000);
    // stops interval after event is finished
    setTimeout(() => clearInterval(eventInterval), duration * 1000);
  }
// displays event duration as a countdown
displays event duration as a countdown
displays event duration as a countdown
displayEventCountdown(id, duration) {
    const currentEvent = document.querySelector(`[data-identity="${id}"] span`);
    let eventDuration = duration - 1;
    const eventInterval = setInterval(() => {
      currentEvent.innerHTML = eventDuration;
      eventDuration -= 1;
    }, 1000);
    setTimeout(() => clearInterval(eventInterval), duration * 1000);
  }
displayEventCountdown ( id , duration ) { const currentEvent = document . querySelector ( ` ${ id } ` ) ; let eventDuration = duration - 1 ; const eventInterval = setInterval ( ( ) => { currentEvent . innerHTML = eventDuration ; eventDuration -= 1 ; } , 1000 ) ; setTimeout ( ( ) => clearInterval ( eventInterval ) , duration * 1000 ) ; }
displays event duration as a countdown
displays event duration as a countdown
// stops interval after event is finished