Templater previous\next day\week\month\quarter\year

I don’t know for sure if I’m publishing it there, but I decided to share the code with you, maybe it will be useful to someone.

Template for Daily.
Format:
<< :rewind: Yesterday(YYYY-MM-DD) | Week: WW | Tomorrow(YYYY-MM-DD) :fast_forward:]] >>

<< [[<% moment(tp.file.title,'YYYY-MM-DD').add(-1,'days').format("YYYY-MM-DD") %>|⏪ Yesterday(<% moment(tp.file.title,'YYYY-MM-DD').add(-1,'days').format("YYYY-MM-DD") %>)]] | [[periodic/weekly/<% moment(tp.file.title,'YYYY-MM-DD').format("YYYY-[W]ww") %>|Week: <% moment(tp.file.title, "YYYY-MM-DD").isoWeek() %>]] | [[<% moment(tp.file.title,'YYYY-MM-DD').add(1,'days').format("YYYY-MM-DD") %>|Tomorrow(<% moment(tp.file.title,'YYYY-MM-DD').add(1,'days').format("YYYY-MM-DD") %>) ⏩]] >>

The rest have approximately the same format:

Template for Weekly:

<< [[<% moment(tp.file.title,'gggg-[W]ww').add(-1,'week').format("gggg-[W]ww") %>|⏪ Last Week(<% moment(tp.file.title,'gggg-[W]ww').add(-1,'week').format("gggg-[W]ww") %>)]] | [[periodic/monthly/<% moment(tp.file.title,'gggg-[W]ww').format("YYYY-MM") %>|Month: <% moment(tp.file.title, "gggg-[W]ww").format("MM") %>]] | [[<% moment(tp.file.title,'gggg-[W]ww').add(1,'week').format("gggg-[W]ww") %>|Next Week(<% moment(tp.file.title,'gggg-[W]ww').add(1,'week').format("gggg-[W]ww") %>) ⏩]] >>

Template for Monthly:

<< [[<% moment(tp.file.title,'YYYY-MM').add(-1,'month').format("YYYY-MM") %>|⏪ Last month(<% moment(tp.file.title,'YYYY-MM').add(-1,'month').format("YYYY-MM") %>)]] | [[periodic/quarterly/<% moment(tp.file.title,'YYYY-MM').format("YYYY-[Q]Q") %>|Quarterly: <% moment(tp.file.title, "YYYY-MM").format("[Q]Q") %>]] | [[<% moment(tp.file.title,'YYYY-MM').add(1,'month').format("YYYY-MM") %>|Next month(<% moment(tp.file.title,'YYYY-MM').add(1,'month').format("YYYY-MM") %>) ⏩]] >>

Template for Quarterly:

<< [[<% moment(tp.file.title,'YYYY-[Q]Q').add(-1,'quarter').format("YYYY-[Q]Q") %>|⏪ Last Quarter(<% moment(tp.file.title,'YYYY-[Q]Q').add(-1,'quarter').format("YYYY-[Q]Q") %>)]] | [[periodic/yearly/<% moment(tp.file.title,'YYYY-[Q]Q').format("YYYY") %>|quarter: <% moment(tp.file.title, "YYYY-[Q]Q").format("YYYY") %>]] | [[<% moment(tp.file.title,'YYYY-[Q]Q').add(1,'quarter').format("YYYY-[Q]Q") %>|Next Quarter(<% moment(tp.file.title,'YYYY-[Q]Q').add(1,'quarter').format("YYYY-[Q]Q") %>) ⏩]] >>

Template for Yearly:

<< [[<% moment(tp.file.title,'YYYY').add(-1,'year').format("YYYY") %>|⏪ Last year(<% moment(tp.file.title,'YYYY').add(-1,'year').format("YYYY") %>)]]  | [[<% moment(tp.file.title,'YYYY').add(1,'year').format("YYYY") %>|Next year(<% moment(tp.file.title,'YYYY').add(1,'year').format("YYYY") %>) ⏩]] >>

This is really handy! Thank you!