Skip to content

armgit / ECC

Public Imported from GitHub
0

The agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.

377 B
Raw Blame
'use strict';

const { parseDate } = require('./dates');

function monthOf(row) {
  const p = parseDate(row.date);
  return `${p.y}-${String(p.m).padStart(2, '0')}`;
}

function totalsByMonth(rows) {
  const totals = {};
  for (const row of rows) totals[monthOf(row)] = (totals[monthOf(row)] || 0) + row.amount;
  return totals;
}

module.exports = { monthOf, totalsByMonth };