src/utils.js
function getWeeks(dates) {
  const weeksLength = Math.ceil(dates.length / 7);
  const weeks = [];
  for (let i = 0; i < weeksLength; i++) {
    weeks[i] = [];
    for (let x = 0; x < 7; x++) {
      weeks[i].push(dates[i * 7 + x]);
    }
  }
  return weeks;
}
function getWeeks(dates) {
  const weeksLength = Math.ceil(dates.length / 7);
  const weeks = [];
  for (let i = 0; i < weeksLength; i++) {
    weeks[i] = [];
    for (let x = 0; x < 7; x++) {
      weeks[i].push(dates[i * 7 + x]);
    }
  }
  return weeks;
}
function getWeeks ( dates ) { const weeksLength = Math . ceil ( dates . length / 7 ) ; const weeks = [ ] ; for ( let i = 0 ; i < weeksLength ; i ++ ) { weeks [ i ] = [ ] ; for ( let x = 0 ; x < 7 ; x ++ ) { weeks [ i ] . push ( dates [ i * 7 + x ] ) ; } } return weeks ; }
Takes an array of dates, and turns them into a multi dimensional
array with 7 entries for each week.
@param {Array.<Object>} dates An array of dates
@returns {Array} The weeks as a multi dimensional array
Takes an array of dates and turns them into a multi dimensional array with 7 entries for each week .