Dear all,
I started to use the book search plugin last week. It is really amazing. I have one small issue: publishDate keeps returning a full date, even though the documentation talks about publication year.
I tried to use {{publishDate:YYYY}}
, but it did not work. I returns an string {{publishDate:YYYY}}. I believe it is possible to extract the year using js with Templater, but first I’d like to see if anyone of you know a way of formatting it without Templater.
Thanks a lot.
You can play with the dateformat function.
I use the following dataview to get count of files by year from the date modified folder
dataview
TABLE length(rows) as Num_Folder
FROM “”
WHERE important = “on”
GROUP BY dateformat(file.mtime, “yyyy”) as Year
LIMIT 10
Year5 |
Num_Folder |
2018 |
97 |
2019 |
91 |
2020 |
39 |
2021 |
24 |
2022 |
48 |
Thanks, Duncan.
I’m looking to have only the year saved in the note.
For now, I used the following code as a workaround:
<%*
const publishDate = "{{publishDate}}"
let publishYear = publishDate.slice(0,4);
tR += `published_at: ${publishYear}`
-%>
1 Like