Embedding Quarterly Goals in a Review Note: Help with syntax needed

During weekly, monthly, and now quarterly reviews, I like to put a heading with the date of the next occurrence ( #2022-Q3 inside [[2022-Q2]] ). I can then using templater embed the goals I set for Q3 inside the review note for Q3.

I cannot seem to get it to work for quarterly though. My monthly looks like this:
# <% tp.date.now("YYYY-MM", "+1M") %>

I want templater to output in this format: 2022-Q3.

This would depend on when you trigger the template, but to add offsets to a date within Templater you can can use the ISO8601 format for defining periods, like using P3M or P-3M to go forward, or back, three months. See Durations on Wikipedia for more examples.

So does your monthly thing actually work?! I couldn’t get it to work using +3M at all. It just ignored that offset…

Anyways, doing the following (today) in a template:

<% tp.date.now("YYYY-MM-DD [Q]Q", "P3M") %> 
<% tp.date.now("YYYY-MM-DD [Q]Q") %>
<% tp.date.now("YYYY-MM-DD [Q]Q", "P-3M") %> 
<% tp.date.now("YYYY-MM-DD [Q]Q", "P12M") %>

Produces:

2023-09-07 Q3 
2023-06-07 Q2
2023-03-07 Q1 
2024-06-07 Q2

So given a format of "YYYY[-Q]Q" that should get you rather close to your wanted output in one of the variation. But do note that as this stands it works related to the current date. The principle of adding/subtracting three months using either “P3M” or “P-3M” should however apply even if you use the relative date variants.

1 Like

<% tp.date.now("YYYY[-Q]Q", "P3M") %> produced the output I was looking for: 2023-Q3

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