How can I sort by file name in dv.pages()? #2121
Unanswered
Oneechan69
asked this question in
Q&A
Replies: 1 comment 6 replies
-
You can try assigning dv.pages to a variable and then try to sort variable.values; like so: let pages = dv.pages("#Obsidian-Tasks")
.where(p => dailyNote(p.file.name))
.file.tasks.where(t => t.status == " "
&& t.text.includes("#Obsidian-Tasks"));
pages.values.sort(p => p.file.name).reverse();
dv.taskList(pages); Since dv.pages returns an object with an array key (named "values") that contains all the values from the vault's pages. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I have this JS to show tasks, which works without the
.sort()
, but when I include it doesn't work like its supposed where it should sort by file name descending.Beta Was this translation helpful? Give feedback.
All reactions