score:0

Accepted answer
//destructure dateUTCString as that's all you are using
deleteTime({ dateUTCString }, name) {
  this.setState({
    data: this.state.data.map(company =>
      name === company.name
        ? {
            ...company,//copy company
            times: company.times.filter(//reset times
              time => time.dateUTCString !== dateUTCString
            ),
          }
        : company//return original company
    ),
  });
}

score:0

deleteTime (timeslot, name) {
    const newState = this.state.data.map(company => {
      if (name === company.name) {
        company.times.splice(company.times.indexOf(time), 1);
      }
      return company
    })
     this.setState({data: newState}) 
  }

Related Query

More Query from same tag