* Get notes for a specific date (just-in-time)
(date: Date)
| 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 |
nothing calls this directly
no test coverage detected