_AddHandlerBtn(data) {
    this._timeBtnsContainer.addEventListener('click', e => {
      const btn = e.target.closest('.time-btn');
      if (!btn) return;

      const timeFormat = btn.dataset.format;

      document
        .querySelectorAll('.time-btn')
        .forEach(btn => btn.classList.remove('active'));

      this._render(data, timeFormat);
    });
  }
/*
    control the event of clicking a button
    1) getting the time format from the data attribute
    2) removing the active class from all butttons before adding it later on the intended one
    3) rendering the data according to the right time format
  */
control the event of clicking a button
1) getting the time format from the data attribute
2) removing the active class from all butttons before adding it later on the intended one
3) rendering the data according to the right time format
control the event of clicking a button 1 ) getting the time format from the data attribute 2 ) removing the active class from all butttons before adding it later on the intended one 3 ) rendering the data according to the right time format
_AddHandlerBtn(data) {
    this._timeBtnsContainer.addEventListener('click', e => {
      const btn = e.target.closest('.time-btn');
      if (!btn) return;
      const timeFormat = btn.dataset.format;
      document
        .querySelectorAll('.time-btn')
        .forEach(btn => btn.classList.remove('active'));
      this._render(data, timeFormat);
    });
  }
_AddHandlerBtn ( data ) { this . _timeBtnsContainer . addEventListener ( 'click' , e => { const btn = e . target . closest ( '.time-btn' ) ; if ( ! btn ) return ; const timeFormat = btn . dataset . format ; document . querySelectorAll ( '.time-btn' ) . forEach ( btn => btn . classList . remove ( 'active' ) ) ; this . _render ( data , timeFormat ) ; } ) ; }
control the event of clicking a button
1) getting the time format from the data attribute
2) removing the active class from all butttons before adding it later on the intended one
3) rendering the data according to the right time format
control the event of clicking a button 1 ) getting the time format from the data attribute 2 ) removing the active class from all butttons before adding it later on the intended one 3 ) rendering the data according to the right time format