HailwoodH
Reactiflux4y ago
1 reply
Hailwood

Hailwood – 00-48 May 9

Is there a less verbose way of doing this now?

  const steps = [];
  for (let value = 15; value <= maxStreamRuntime; value += 15) {
    if (value < 60) {
      steps.push({label: `${value} minutes`, value});
    } else if (value === 60) {
      steps.push({label: `${value} minutes (1 hour)`, value});
    } else {
      steps.push({label: `${value} minutes (${value / 60} hours)`, value});
    }
  }
Was this page helpful?