From 035ebaca809445b57cdb87a0ceb4ff7cc5cb3baf Mon Sep 17 00:00:00 2001 From: ahonn Date: Sun, 23 Apr 2023 18:56:44 +0800 Subject: [PATCH] feat: including TODOs from future daily note pages, #52 --- src/App.tsx | 8 ++------ src/querys/next-n-days.ts | 8 ++------ src/querys/scheduled.ts | 13 +++++++------ 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index 1c1ba89..1305619 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -104,10 +104,7 @@ function App() { {settings.showNextNDaysTask && ( )} '"' + m + '"').join(' '); const query = ` [:find (pull ?b [*]) :where [?b :block/marker ?marker] - [(contains? #{"NOW" "LATER" "TODO" "DOING" ${markers}} ?marker)] + [(contains? #{"NOW" "LATER" "TODO" "DOING"} ?marker)] [?b :block/page ?p] (or [?b :block/scheduled ?d] diff --git a/src/querys/scheduled.ts b/src/querys/scheduled.ts index d3f067e..1249972 100644 --- a/src/querys/scheduled.ts +++ b/src/querys/scheduled.ts @@ -2,20 +2,21 @@ import dayjs, { Dayjs } from 'dayjs'; export default function getScheduledTaskQuery( startDate: Dayjs | Date = new Date(), - customMarkers: string[] = [], ) { const start = dayjs(startDate).format('YYYYMMDD'); - const markers = customMarkers.map((m) => '"' + m + '"').join(' '); - const query = ` [:find (pull ?b [*]) :where [?b :block/marker ?marker] - [(contains? #{"NOW" "LATER" "TODO" "DOING" ${markers}} ?marker)] + [(contains? #{"NOW" "LATER" "TODO" "DOING"} ?marker)] [?b :block/page ?p] (or - [?b :block/scheduled ?d] - [?b :block/deadline ?d]) + (or + [?b :block/scheduled ?d] + [?b :block/deadline ?d]) + (and + [?p :block/journal? true] + [?p :block/journal-day ?d])) [(> ?d ${start})]] `;