Hey guys, pretty new to dataviewjs, I have a query in regular dataview that displays the age of a note but recently I replaced it with a dataviewjs query with more functionality. The problem is, I do not know how to pull in the same Age output in the dataviewjs query:
TABLE WITHOUT ID status as "status__", file.link as "Name", date(today) - file.day as "Age_____"
FROM #🌱/📝 AND !"Templates" and -"periodic"
SORT (date(today) - file.day) DESC
For my note processing dashboard, I’d like to know the age of the note. Here is my new query:
const {update} = this.app.plugins.plugins["metaedit"].api
const {createButton} = app.plugins.plugins["buttons"]
dv.paragraph("### 📝 New Index/ Miscellaneous Notes");
dv.table(["Name", "", ""], dv.pages("#🌱/📝" + ' and !"templates"')
.sort(t => t.file.mtime, 'asc')
.where(t => t.status == "#🌱/📝")
.map(t => [t.file.link,
createButton({app, el: this.container, args: {name: "🌱"}, clickOverride: {click: update, params: ['status', '#🌱/📝', t.file.path]}}),
createButton({app, el: this.container, args: {name: "🌞"}, clickOverride: {click: update, params: ['status', '#🌞/📝', t.file.path]}}),
createButton({app, el: this.container, args: {name: "🌲"}, clickOverride: {click: update, params: ['status', '#🌲/📝', t.file.path]}})
]
)
)
If anyone could help out, I’d be incredibly grateful! I really enjoy seeing how to recreate simple dataview queries in dataviewjs and would be interested in learning javascript just for this reason!