Templater formula link to "next month"

Hi everyone,

I am trying to create a template with a header, that links to the day and month before and ahead. I am using the templater plugin and the periodic dates plugin.

This is my code:

yesterday | today | tomorrow
[[<% tp.date.now("YYYY-MM-DD (ddd)", -1, tp.file.title, "YYYY-MM-DD (ddd)") %>]] | <% tp.date.now("YYYY-MM-DD (ddd)", 0, tp.file.title, "YYYY-MM-DD (ddd)") %> | [[<% tp.date.now("YYYY-MM-DD (ddd)", 1, tp.file.title, "YYYY-MM-DD (ddd)") %>]]

last month | this month | next month
[[<% tp.date.now("YYYY-MM-MMMM", -1, tp.file.title, "YYYY-MM-MMMM") %>]] | <% tp.date.now("YYYY-MM-MMMM", 0, tp.file.title, "YYYY-MM-MMMM") %> | [[<% tp.date.now("YYYY-MM-MMMM", 1, tp.file.title, "YYYY-MM-MMMM") %>]]

The problem:
the link to the upcoming month renders the same result as the actual / current month. I can’t see why this is happening?

I really appreciate your help.
Thanks!

Not a code I use but I think you need to use the P-1M and P1M codes to get last and next months, see

Date Module | Templater (silentvoid13.github.io)

The -1 and 1 offsets will refer to days. Please correct me if I’m wrong!

1 Like

Thanks a lot! It worked out. This is my new code:

[[<% tp.date.now("YYYY-MM-MMMM", "P-1M", tp.file.title, "YYYY-MM-MMMM") %>]] | 
**[[<% tp.date.now("YYYY-MM-MMMM", " ", tp.file.title, "YYYY-MM-MMMM") %>]]** | 
[[<% tp.date.now("YYYY-MM-MMMM", "P1M", tp.file.title, "YYYY-MM-MMMM") %>]]
2 Likes

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