What I’m trying to do
I’m stuck with the navigation bar in my daily notes. I’m basing myself on the template My Obsidian Daily Note Template | Dann Berg: blog, newsletter, shop, and more .
I started with the navigation bar < Yesterday | WK-46 | Tomorrow > . But while navigating through earlier notes, it is not always very clear to which page I’m going. So I adapted the formula and now the navigation bar looks like:
< 2022-11-17-Thursday | WK-46 | 2022-11-19-Saturday >
I would like to strip the day name in the navigation bar < 2022-11-17 | WK-46 | 2022-11-19 > while the filenames remain in the format “YYYY-MM-DD-dddd” and I’m not sure how I can achieve this result.
The following script line is working for printing a date in the format “YYYY-MM-DD-dddd”:
[[<% moment(tp.file.title, ‘YYYY-MM-DD-dddd’).subtract(1, ‘d’).format(“YYYY-MM-DD-dddd”) %>]]
But if I strip the format part to “YYYY-MM-DD”, the link is also changed to "YYYY-MM-DD and I prefer to keep my daily notes in the format “YYYY-MM-DD-dddd”.
With a fixed text ( “Yesterday” here ) it should be this:
[[<% fileDate = moment(tp.file.title, ‘YYYY-MM-DD-dddd’).subtract(1, ‘d’).format(‘YYYY-MM-DD-dddd’) %>|Yesterday]]
Is it possible to show a date “YYYY-MM-DD” while the filenames for the daily notes are in a different format? I can’t find any examples or help concerning this. This involves Templater and Moment.js .