You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for this awesome budding plugin.
If dataviewjs syntax also can be supported it will be further useful.
A sample dataviewjs script for notes created/modified today:
// default dateformat in case it’s forgotten in front matter
var dateformat = "YYYY-MM-DD";
if (dv.current().dateformat) { dateformat = dv.current().dateformat; }
dv.table(["File", "LastModifiedOn", "CreatedOn"],
dv.pages()
.where(p => p.file.mday.equals(dv.current().file.day) || p.file.cday.equals(dv.current().file.day))
.sort(p => p.file.mtime, 'asc')
.map(p => [
p.file.link,
moment(p.file.mtime.toString()).format(dateformat),
moment(p.file.ctime.toString()).format(dateformat),
])
);
The text was updated successfully, but these errors were encountered:
soumendrak
changed the title
Add support for dataviewjs syntax
✨[Feature Request] Add support for dataviewjs syntax
May 27, 2024
Instead of doing dv.table(headers, values) just return an object with keys for headers and values
Let me know if the following doesn't work :) Note I am unsure about the dateformat being respected as I hadn't considered that.
// default dateformat in case it’s forgotten in front mattervardateformat="YYYY-MM-DD";if(dv.current().dateformat){dateformat=dv.current().dateformat;}return{headers: ["File","LastModifiedOn","CreatedOn"],values:
dv.pages().where(p=>p.file.mday.equals(dv.current().file.day)||p.file.cday.equals(dv.current().file.day)).sort(p=>p.file.mtime,'asc').map(p=>[p.file.link,moment(p.file.mtime.toString()).format(dateformat),moment(p.file.ctime.toString()).format(dateformat),])};
Thanks for this awesome budding plugin.
If dataviewjs syntax also can be supported it will be further useful.
A sample dataviewjs script for notes created/modified today:
The text was updated successfully, but these errors were encountered: