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

Function buildDateNoteIndexes

packages/app-core/src/lib/vault-layout.ts:1092–1107  ·  view source on GitHub ↗
(
  notes: readonly NoteMeta[],
  settings: VaultSettings | null | undefined
)

Source from the content-addressed store, hash-verified

1090}
1091
1092export function buildDateNoteIndexes(
1093 notes: readonly NoteMeta[],
1094 settings: VaultSettings | null | undefined
1095): DateNoteIndexes {
1096 const dailyByDate = new Map<string, NoteMeta>()
1097 const weeklyByWeek = new Map<string, NoteMeta>()
1098
1099 for (const note of notes) {
1100 const info = classifyDateNote(note, settings)
1101 if (!info) continue
1102 if (info.kind === 'daily') dailyByDate.set(noteTitleForDate(info.date), note)
1103 else weeklyByWeek.set(weeklyNoteTitle(info.date), note)
1104 }
1105
1106 return { dailyByDate, weeklyByWeek }
1107}
1108
1109/**
1110 * Map every daily note to its own date as `vault-relative path -> YYYY-MM-DD`

Callers 1

CalendarPanelFunction · 0.90

Calls 3

classifyDateNoteFunction · 0.85
noteTitleForDateFunction · 0.85
weeklyNoteTitleFunction · 0.85

Tested by

no test coverage detected