MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / buildMonthGrid

Function buildMonthGrid

packages/app-core/src/components/TasksCalendar.tsx:77–83  ·  view source on GitHub ↗
(anchor: Date, firstDay: number)

Source from the content-addressed store, hash-verified

75}
76
77function buildMonthGrid(anchor: Date, firstDay: number): Date[] {
78 const first = firstOfMonth(anchor)
79 // Walk back to the most recent `firstDay` weekday (may be in the prev month).
80 const offset = (first.getDay() - firstDay + 7) % 7
81 const start = addDays(first, -offset)
82 return Array.from({ length: 42 }, (_, i) => addDays(start, i))
83}
84
85function formatMonthLabel(d: Date): string {
86 return d.toLocaleDateString(undefined, { month: 'long', year: 'numeric' })

Callers 1

TasksCalendarFunction · 0.85

Calls 2

firstOfMonthFunction · 0.85
addDaysFunction · 0.85

Tested by

no test coverage detected