What I’m trying to do
I am trying to use a Tasks block (from the Tasks plugin) to group tasks by heading, which is the day of the week, from within a note that was created using the Kanban board plugin.
I want the day of the week to be in the same order that it is written in the note (i.e., in the order of the actual days of the week), but I can’t find documentation about how to do this.
The actual Markdown source of the kanban board is fairly plain, like this:
### Monday
- [ ] Chili
### Tuesday
- [ ] Tacos
### Wednesday
- [ ] Nachos
### Thursday
- [ ] Chicken Tortilla Soup
### Friday
- [ ] Chicken and Barley Soup
The Tasks block that I currently have lists the headings and groups accordingly, but it sorts alphabetically rather than by the day of the week:
short mode
filter by function task.file.filename.includes("Weekly Menu")
filter by function task.heading.includes("day")
group by heading
Things I have tried
I’m not really sure how to sort a grouping based on a property that isn’t tied to some kind of metadata field or date. I don’t really know any JavaScript. The only thing that seemed to work was prepending numbers to each heading, which will require a regex replacement so as to achieve the desired result:
### 01 Monday
### 02 Tuesday
### 03 Wednesday
etc.
While this will work, I was hoping that someone more experienced than me might have a more elegant solution.
I also saw a previous post that I believe had the same problem, but the original poster mistakenly thought it was a Dataview query so no one was able to help them. So maybe this will help others.