What I’m trying to do
I would like to find a solution to sorting a dataviewjs table that uses Metadata Menu to generate a list of project notes. When I sort by deadline (which is a date property in all of my project notes), the notes without a date are listed at the top. I would like them to be at the bottom (after a list of notes sorted by deadline asc).
Here is my query:
const {fieldModifier: f} = this.app.plugins.plugins["metadata-menu"].api;
dv.table(["project", "today?", "deadline"],
dv.pages('')
.where(p => p.scheduled == false)
.where(p => p.priority == "⏫️")
.sort(k => [k.deadline, 'asc'])
.map(p => [
p.file.link,
f(dv, p, "scheduled"),
f(dv, p, "deadline")
])
)
// change column width
this.container.querySelectorAll(".table-view-table td").forEach(s => s.style.width ="300px");
Things I have tried
I found a solution for regular dataview on this thread (Sorting so the date works in Dataviews), but would like to have a solution for dataviewjs.