First, search the help docs and this forum. Maybe your question has been answered! The debugging steps can help, too. Still stuck? Delete this line and proceed.
What I’m trying to do
I often need to go back to the previous day and review or update a previous Daily Note. I found a function in a “how to” video, but it doesn’t work. Below is the code. Can anyone tell me what is broken?
Thank you. I have templater, although I haven’t gotten productive with it yet. The code is in a template that I created. The first line, which is simply the date and time works fine. The next line of code is what I have shared. I will give your suggestion to try the .now function. I will update post later today.
Hi, I like the idea of using Dataview, especially the idea/function of scrolling dates back and forth. I have been struggling with Dataview, but this may be a good catalyst in helping learn it more effectively. Thank you.
Note that any code executed by Templater will produce the correct previous/next link at the time of inserting the template. So unless you want it to always refer to yesterday and tomorrow for any given date, a dynamic solution like the one using Dataview would be a better option.
Templater is never “re-executed” at a later time, so if you originally had the previous note to be a month earlier, and later on added a note in between those two notes it wouldn’t be linked by the previous link.
I tried the code but it didn’t work. All of the examples that I have seen for Dataview code begin and end with \. The example that you provided begin and end with << >>.
You can leave the << >>. In my example it was just to have some visual indicator that you are going forward or backward, but it’s not part of the coding.
EDIT: The code snippet I provided will work in any case, as long as you
have installed and activated Dataview plugin
your daily notes have a date in their title
you copy and paste the snippet as it is directly in your template (or any other note with a date in its title)
you replace the string <your daily log folder> with the path to the folder you store your daily notes in, so it will look something like this dv.pages('"CALENDAR/DAILY"')
you even can leave it blank (regardless of using a folder for your daily notes or storing them under root), when it will look like dv.pages()
Ahh, thanks for explaining the << >>. I read it that way when I first saw your post, but my brain checked out and I got lost in my own entanglement. I’ll experiment and post a reply over the weekend.