Tasks filtered by Due Date "this Week" and "Last Week" (not 7 days ago or within 7 days)

Using Dataview

Example 1 - this week, not completed, high priority

where due >= date(sow)
where due <= date(eow)
where !completed
Where contains(text,"⏫")

to check or play with the dates, type (exactly as below, each code in separate lines):

Example 2 - last week

where due >= date(sow) - dur(7 days)
where due <= date(eow) - dur(7 days)
where completed

Using Tasks Plugin

I have a page called “This Week” where I group tasks by priority. Since I can not group by priority using Dataview, I use the Obsidian Tasks plugin with Templater

="W" + (date(today).weekyear) | =dateformat(date(today), "MMMM dd, yyyy - cccc")

(due after <% tp.date.weekday("YYYY-MM-DD", -1) %>) AND (due before <% tp.date.weekday("YYYY-MM-DD", 7) %>)
is not recurring
not done
hide task count
group by priority
  • the inconvenience is that I have to run the templater every beginning of the week - tried to use “dynamic Commands” by not succeeded