MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / getWeekStart

Function getWeekStart

scripts/get-changelog.ts:22–29  ·  view source on GitHub ↗
(date: Date)

Source from the content-addressed store, hash-verified

20
21// Helper functions for date manipulation
22function getWeekStart(date: Date): Date {
23 const d = new Date(date)
24 const day = d.getDay()
25 const diff = d.getDate() - day + (day === 0 ? -6 : 1) // Monday as start of week
26 d.setDate(diff)
27 d.setHours(0, 0, 0, 0)
28 return d
29}
30
31function getWeekEnd(date: Date): Date {
32 const d = new Date(date)

Callers 1

generateChangelogFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected