function dedupeSegmentEfforts(efforts) {
  return efforts.reduce((acc, effort) => {
    // Make array of start times that have already been included
    const startTimes = acc.map(({ start_date_local }) => start_date_local);
    // Check that activity w/ this start time hasn't been included already
    if (startTimes.indexOf(effort.start_date_local) === -1) {
      acc.push(effort);
    }
    return acc;
  }, []);
}
/**
 * Dedupe segment efforts from JSON array
 * NOTE: Assumes all segment efforts refer to the same segment!
 * @todo: Test with array of SegmentEffort documents
 *
 * @param {Array} efforts
 * @return {Array} Deduped efforts
 */
Dedupe segment efforts from JSON array
NOTE: Assumes all segment efforts refer to the same segment.
@todo: Test with array of SegmentEffort documents

@param {Array} efforts
@return {Array} Deduped efforts
Dedupe segment efforts from JSON array NOTE : Assumes all segment efforts refer to the same segment . @todo : Test with array of SegmentEffort documents @param { Array } efforts @return { Array } Deduped efforts
function dedupeSegmentEfforts(efforts) {
  return efforts.reduce((acc, effort) => {
    const startTimes = acc.map(({ start_date_local }) => start_date_local);
    if (startTimes.indexOf(effort.start_date_local) === -1) {
      acc.push(effort);
    }
    return acc;
  }, []);
}
function dedupeSegmentEfforts ( efforts ) { return efforts . reduce ( ( acc , effort ) => { const startTimes = acc . map ( ( { start_date_local } ) => start_date_local ) ; if ( startTimes . indexOf ( effort . start_date_local ) === - 1 ) { acc . push ( effort ) ; } return acc ; } , [ ] ) ; }
Dedupe segment efforts from JSON array
 NOTE: Assumes all segment efforts refer to the same segment!
Dedupe segment efforts from JSON array NOTE : Assumes all segment efforts refer to the same segment!
// Make array of start times that have already been included // Check that activity w/ this start time hasn't been included already