MCPcopy Create free account
hub / github.com/QodeXcli/QodeX / inWindow

Function inWindow

src/cli/maintain-stats.ts:135–138  ·  view source on GitHub ↗
(r: MaintainRun, from: number, to: number)

Source from the content-addressed store, hash-verified

133export function weeklyReport(runs: MaintainRun[], nowMs: number): MaintainWeekly {
134 const DAY = 86_400_000;
135 const inWindow = (r: MaintainRun, from: number, to: number) => {
136 const t = r.at ? Date.parse(r.at) : NaN;
137 return Number.isFinite(t) && t >= from && t < to;
138 };
139 const thisWeek = runs.filter(r => inWindow(r, nowMs - 7 * DAY, nowMs));
140 const priorWeek = runs.filter(r => inWindow(r, nowMs - 14 * DAY, nowMs - 7 * DAY));
141 const opened = thisWeek.filter(r => r.status === 'opened');

Callers 1

weeklyReportFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected