Cross post with Tasks plugin: how to sort groups? · obsidian-tasks-group/obsidian-tasks · Discussion #2723 · GitHub
What I’m trying to do
I would like to sort groups based on the task.happens
date.
I have this code:
```tasks
filter by function task.file.folder.includes('Work') || task.file.folder.includes('Daily notes')
filter by function task.status.symbol == ' '
group by folder
group by function '%%' + task.happens.format("YYYY-MM-DD") + '%%'
group by filename
```
Here is an output. Sorry for the sanitization:
As you can see, the note 2024-03-20
is listed twice.
This is because the third element has a Due date later than the date inferred from the note filename (I have that option on at the plugin options).
What I want, is the group by
at line:
group by function '%%' + task.happens.format("YYYY-MM-DD") + '%%'
… only return the minimum date from all the dates in the filename
.
Things I have tried
The code bellow. And a bunch of alternatives. Non worked.
Maybe something like:
sort by function Math.min(task.happens)
… but does not work.
Any ideas?
Thanks!
I am using:
- Tasks 6.2.0
- Obsidian 1.5.11