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()

    .sort(p =>, "desc")
    .where(p => dailyNote(
    .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.