Next/Prev links on daily notes not working on new daily notes

I have links on my daily notes to the Next and Previous daily notes. The script (shown below) is suddenly not working on newly created notes, but it still works on all my old daily notes up until a few days ago. I can’t figure out what might have changed. Anyone have an idea? Here’s a copy of my current script:

< [[<% tp.date.now(“YYYY-MM-DD • dddd”,-1,tp.file.title,“YYYY-MM-DD • dddd”) %>]] <<< • >>> [[<% tp.date.now(“YYYY-MM-DD • dddd”,1,tp.file.title,“YYYY-MM-DD • dddd”) %>]] >

It appears I may be missing a couple of plugins that I had before, but it’s not obvious to me which one this relies on, or why the plugin suddenly went missing.

Thanks for you help.

Using this:

< [[<% tp.date.now("YYYY-MM-DD • dddd",-1,tp.file.title,"YYYY-MM-DD • dddd") %>]] <<< • >>> [[<% tp.date.now("YYYY-MM-DD • dddd",1,tp.file.title,"YYYY-MM-DD • dddd") %>]] >

is working fine for me when applied to a note with the name of 2024-07-19 ( YYYY-MM-DD ). You probably don’t have the Templater community plugin installed or configured properly. That should do it. The above is all Templater syntax.

Thanks for your response. I do have Templater installed, but it’s not activating the script when I click on a new calendar date like it used to. If I click on the Templater icon in the ribbon along the left side of Obsidian and then click on the template name, it does work, duplicating all the rest of the template already placed from clicking the calendar date, but the prev/next links work. I’m sure it must be something got changed in the settings of Templater, but I can’t figure out what it is that is preventing the script from initially being executed.

If you were clicking on the (community plugin) Calendar’s icon to trigger the template previously, this needs to be enabled in Templater’s settings. Something to double check.

1 Like

Maybe give this a try:

<% moment(tp.file.title, "YYYY-MM-DD").add(-1, 'days').format("YYYY-MM-DD") %>
<% moment(tp.file.title, "YYYY-MM-DD").add(1, 'days').format("YYYY-MM-DD") %>

It’s how I derive the date using Templater for my daily note nav buttons. Not sure if either way is better necessarily.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.