MCPcopy
hub / github.com/callumalpass/tasknotes / getNotesForDate

Method getNotesForDate

src/utils/TaskManager.ts:872–902  ·  view source on GitHub ↗

* Get notes for a specific date (just-in-time)

(date: Date)

Source from the content-addressed store, hash-verified

870 * Get notes for a specific date (just-in-time)
871 */
872 async getNotesForDate(date: Date): Promise<NoteInfo[]> {
873 if (this.disableNoteIndexing) return [];
874
875 const notes: NoteInfo[] = [];
876 const dateStr = formatDateForStorage(date);
877 const files = this.app.vault.getMarkdownFiles();
878
879 for (const file of files) {
880 if (!this.isValidFile(file.path)) continue;
881
882 const metadata = this.app.metadataCache.getFileCache(file);
883 if (!metadata?.frontmatter) continue;
884
885 // Skip task files
886 if (this.isTaskFile(metadata.frontmatter)) continue;
887
888 // Check if note is associated with this date
889 const noteDate = metadata.frontmatter.date || metadata.frontmatter.scheduled;
890 if (noteDate === dateStr) {
891 notes.push({
892 path: file.path,
893 title: this.storeTitleInFilename
894 ? file.basename
895 : metadata.frontmatter.title || file.basename,
896 tags: metadata.frontmatter.tags || [],
897 });
898 }
899 }
900
901 return notes;
902 }
903
904 /**
905 * Compatibility method - same as getTaskInfo

Callers

nothing calls this directly

Calls 5

isValidFileMethod · 0.95
isTaskFileMethod · 0.95
formatDateForStorageFunction · 0.90
getMarkdownFilesMethod · 0.80
getFileCacheMethod · 0.80

Tested by

no test coverage detected