Trying to add a section to a template where it displays the current date and I want to display the date 5 days ago to make a “Week of: first date to current date”. This is to create a weekly review document every Friday that on creation, assigns the proper work week
In the end the template should function like this:
Week of: {{date - 5days}} to {{date}}
Things I have tried
Ive tried using this format although it does not accomplish the above functionality
Current Date: {{date:YYYY-MM-DD}}
Date 5 days before: {{date:YYYY-MM-DD -5d}}
I use regularly the Templater plugin for this kind of thing. Not sure if this can be done without community plugins.
<% tp.date.now(“YYYY-MM-DD”) %> will output today’s date as YYYY-MM-DD
<% tp.date.now(“YYYY-MM-DD”).add(-1, ‘days’).format(“YYYY-MM-DD”) %> will output yesterday’s date as YYYY-MM-DD
You can use Templater functions to return the date of the first day of the week (I think this is what you want), but I can’t remember how to format it.