Skip to content

Commit

Permalink
Support tasks in files inside the daily notes folder that are not dai…
Browse files Browse the repository at this point in the history
…ly notes
  • Loading branch information
larslockefeer committed Jan 7, 2022
1 parent 01f12d8 commit 679c430
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions DemoVault/Daily Notes/Not a daily note.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- [ ] This is a task in a file in the daily note folder without a date
4 changes: 3 additions & 1 deletion util/DailyNoteParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ export const extractDueDateFromDailyNotesFile = (filePath: string): DateTime | u
const dailyNotesSettings = getDailyNoteSettings();
if (dailyNotesSettings.folder && path.dirname(filePath) == dailyNotesSettings.folder) {
const dueDate = getDateFromPath(filePath, 'day');
return DateTime.fromISO(dueDate.toISOString());
if (dueDate != null) {
return DateTime.fromISO(dueDate.toISOString());
}
}
return undefined;
};

0 comments on commit 679c430

Please sign in to comment.