Periodic Notes: set file name to previous month/quarter/year

Things I have tried

I know that with templater you can manipulate the current date like that, for example: <“YYYY-[M]MM”, -45)%>, I tried something similar with the periodic notes plugin put it didn’t work.

What I’m trying to do

I’m trying to change the settings of the periodic notes so when I create, for example, a monthly note with the “Open monthly note” hotkey, it doesn’t create this month’s note (2023-M03, in this case) instead it opens/creates the monthly note of the previous month (2023-M02).

Here’s the current format from the settings for the monthly note: YYYY/YYYY-[M]MM
Quarterly: YYYY/YYYY-[Q]Q
Yearly: YYYY

Since I’d like to create these notes in the beginning of the following month/quarter/year I think a good solution would be to subtract approx. 15 days from the current date, just to be on the safe side, in case I don’t get to creating the note right on the first day of the following period.

As far as I know that’s not possible. Periodic Notes has template tags that do date math, but they only work for note text. i think you’ll need to find another solution: Templater, external app, create your notes earlier, etc.

If you’re on Mac/iOS, you could probably rig something up in Shortcuts and trigger it with the Shortcuts Launcher community plugin.

Maybe I’m just old-fashioned, and don’t know how this plugin works, but can’t you just change the month in the calendar view to the correct month, and then hit the hotkey? Or are you only using the keyboard?

In any case, does this hotkey trigger a Templater template since it’s a new note? Could you potentially add some code to that, and move the file to the previous month if need be?

The logic you’re describing should be easy enough to implement within Templater, but I’m not sure what will happen when you try to open it after its created.

A third option, could be to have links within your current daily notes, which links to the monthly note, and then use that link to create/open the monthly note.

Lastly, you could consider making some QuickAdd macro(s) to trigger either the creation or opening of the “correct” monthly template, and replace the “Open monthly note” from Periodic Notes to use your custom variant instead. This is most likely the better option, when you get it setup properly.

1 Like

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