Skip to content

Instantly share code, notes, and snippets.

@GitMurf
Created September 23, 2021 19:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GitMurf/c48231d090fe5db85ecafe1ed990bac4 to your computer and use it in GitHub Desktop.
Save GitMurf/c48231d090fe5db85ecafe1ed990bac4 to your computer and use it in GitHub Desktop.
<%*
const search = app.workspace.getLeavesOfType("search")[0];
search.view.setSortOrder("byCreatedTime");
search.view.setCollapseAll(false);
search.view.setExtraContext(true);
const dnp = tp.date.now('YYYY-MM-DD');
const dnp2 = tp.date.now('YYYY_MM_DD');
let myString = `((file:${dnp2} task-todo:"[ ]") OR ((/Due Date: .*\\[\\[${dnp}\\]\\].*/ OR /due date: \\[[0-9, -]*${dnp}[0-9, -]*\\]/) task-todo:"[ ]") OR (file:${dnp} task-todo:"[ ]") OR (task-todo:"${dnp}") OR section:(/^\#.*${dnp}/ "[ ]") OR section:(/^\#.*${dnp}/ section:("[ ]"))) -file:("weekly review")`;
search.view.setQuery(`${myString}`);
app.workspace.revealLeaf(search);
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment