What I’m trying to do
I’m trying to build a query that is going to return my upcoming tasks for the week, grouped by day of the week. What I’d also like is for the group headings to be renamed to the day of the week rather than the ISO date. Example:
Monday
- This is a task due Monday
Tuesday
- This is a task due Tuesday
Wednesday
- This is a task due Wednesday
Thursday
- This is a task due Thursday
Things I have tried
I got the basic functionality down with this:
```dataview
TASK
FLATTEN text + " 🔗 " + file.link as visual
WHERE !completed and due >= date(today) and due <= date(today) + dur(7 days)
GROUP BY due
SORT due ASC
which returns what I want, functionally, just like above: tasks grouped by their date, and those groups listed in order. (I use the FLATTEN command to tack on a custom backlink, I don’t like how the Tasks plug-in formats them).
But the group headings are ISO (2025-01-16 etc.) and I would like them to read as the day of the week. So I try this:
```dataview
TASK
FLATTEN text + " 🔗 " + file.link as visual
WHERE !completed and due >= date(today) and due <= date(today) + dur(7 days)
GROUP BY dateformat(due, "EEEE")
SORT due ASC
but of course, that changes the headers to strings, which means the groups themselves are sorted alphabetically (Friday, Monday, Thursday, Tuesday, Wednesday, etc.)
Is there a way to rename the group headers to strings after the groups are sorted by their date, in a way that won’t re-sort them alphabetically? Do I need DataviewJS for this? I know a little Python, and even less Javascript. Thank you!