import { startOfDay, getTime, parse } from 'date-fns';
import R from 'ramda';

export function countByCreationDay(issues) {
  return R.countBy(getCreationDay)(issues);
}

export function getCreationDay(issue) {
  const date = parse(issue.created_at);
  return getTime(startOfDay(date));
}

export function buildSeriesDataFromDatesWithValues(datesWithValues) {
  return R.map(date => {
    return makeSeriesObject(date, datesWithValues[date]);
  }, R.keys(datesWithValues));
}

function makeSeriesObject(key, value) {
  return { x: Number(key), y: value };
}

@@ -359,99 +359,100 @@
 %7B%0A  
-return R.map(date =%3E %7B%0A    return makeSeriesObject(date, datesWithValues%5Bdate%5D);%0A  %7D, R.key
+const functor = pair =%3E makeSeriesObject(pair%5B0%5D, pair%5B1%5D);%0A  return R.map(functor, R.toPair
 s(da

Improve buildSeriesDataFromDatesWithValues implementation