Make a Conditional Todo List with Tasks and Templater

Plugins Used:

Todos should be in the form of: (remove escaped backticks in your template)

# todo/day-of-the-week

- [ ] 1

- [ ] 2

- [ ] 3

Template:

<%* let day = tp.date.now("dd")

if (day == "Su") { %>

\`\`\`tasks
not done
heading includes todo/sunday
\`\`\`

<%* } else if (day == "Sa") { %>

\`\`\`tasks
not done
heading includes todo/saturday
\`\`\`

<%* } else if (day == "Fr") { %>

\`\`\`tasks
not done
heading includes todo/friday
\`\`\`

<%* } else if (day == "Th") { %>

\`\`\`tasks
not done
heading includes todo/thursday
\`\`\`

<%* } else if (day == "We") { %>

\`\`\`tasks
not done
heading includes todo/wednesday
\`\`\`

<%* } else if (day == "Tu") { %>

\`\`\`tasks
not done
heading includes todo/tuesday
\`\`\`

<%* } else if (day == "Mo") { %>

\`\`\`tasks
not done
heading includes todo/monday
\`\`\`

<%* } else { %>

*error loading day's tasks, check [[Daily Notes Template]] and console*

<%* } %>
1 Like

Hi @bram , you could simplify the template if you want like this:

```tasks
not done
heading includes todo/<% tp.date.now("dddd").toLowerCase() %>
```

That’s the whole Templater template there, no need for the if/else statements.

3 Likes

@AlanG thank you for the tip, didn’t know I could do that!

1 Like