MCPcopy Create free account
hub / github.com/Openpanel-dev/openpanel / getWeekStart

Function getWeekStart

packages/db/src/clickhouse/migration.ts:256–263  ·  view source on GitHub ↗
(date: Date)

Source from the content-addressed store, hash-verified

254
255 // Helper function to get the start of the week (Monday) for a given date
256 const getWeekStart = (date: Date): Date => {
257 const d = new Date(date);
258 const day = d.getDay();
259 const diff = d.getDate() - day + (day === 0 ? -6 : 1); // Adjust to Monday
260 d.setDate(diff);
261 d.setHours(0, 0, 0, 0); // Normalize to start of day
262 return d;
263 };
264
265 // Helper function to compare dates based on interval
266 const shouldContinue = (

Callers 2

shouldContinueFunction · 0.85
moveDataBetweenTablesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected