For Dataviewjs, how can I sort by file name in dv.pages()?

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.

const dailyNote = (t) => { 
    return moment(t, "YYYY-MM-DD MMMM Do YYYY dddd", true).isValid()
};

dv.taskList(dv.pages("#Obsidian-Tasks")
    .sort(p => p.file.name, "desc")
    .where(p => dailyNote(p.file.name))
    .file.tasks.where(t => t.status == " " 
    && t.text.includes("#Obsidian-Tasks")
))

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.