Daily note template for each day of the week?

Hello,

I’m wondering if someone can help me figure out how to use Templater to construct different daily notes for each day of the week (mon, tues, etc.). The idea being to have daily notes reflect my periodic chores/practices based on the day; e.g. Monday might be laundry day. Tuesday might be meditation, etc.

Is there a way to use Templater to do this? I’ve been unable to find a solution by searching the forum but perhaps I’ve missed something? Can anyone make some suggestions - I have a feeling templater is the way to go but I’m just a little too tech illiterate to figure it out on my own, I’d greatly appreciate some help if anyone knows how to do this! :slight_smile:

Warmest,
j

1 Like

My personal solution unfortunately strays into the deep end of the technical pool. It starts with four independent note files:

  • recurring.weekly.md holds a list of formatted items that occur on a particular day of the week
  • recurring.monthly.md holds a list of formatted items that occur on a particular day of the month. Includes things like reminders to download bank and credit card statements.
  • recurring.yearly.md holds a list of formatted items that occur on a particular day of the year. Includes things like birthdays and anniversaries.
  • events.md holds a list of formatted items that happen on a particular date. Includes things like work holidays since they vary by year, scheduled meetings and events, and reminders of when things like passports or drivers licenses expire

I then have a JavaScript function for each of these note files that that parses the content and returns items that match the current day.

Finally, my daily note template calls each of these functions in turn as it builds the contents of my day.

For example, the contents of recurring.weekly.md might look something like:

+ {Mon} work:: Weep because a new work week is starting
+ {Mon} work:: Weekly one-on-one with pointy-haired boss @ 10:00
+ {Wed} work:: Hump day has arrived; maybe I really will survive this endless week
+ {Fri} work:: Rejoice, the weekend is nigh

The function to parse this note looks like (Note: on my system this function is defined inside a object so there it has different declaration syntax.):

async function itemsFromWeekly()
{
   const options = { weekday: 'short' };
   const today = new Date();
   const wStr = today.toLocaleDateString("en-US", options);

   let out = '';
   const tf = app.vault.getAbstractFileByPath('facet.journal/future/recurring.weekly.md');
   const source = await app.vault.read(tf);
   const items = source.split('\n');
   for (let i = 0; i < items.length; i++);
   {
      const re = /\{(...)\}\s(.*)/;
      const f = items[i].match(re);

      if (f !== null && f[1] == wStr)
      {
         out += `   + ${f[2]}\n`;
      }
   }
   return out;
}

Finally my daily template is (Note: there is some stuff in here I did not touch on):

<%*
tp.user.journal().summarizeNow();
-%>
# <% tp.date.now("YYYY.MM.DD (ddd)") %>
   + health:: arise:<% tp.file.cursor() %>
   + health:: weight:
<%*
tR += await tp.user.journal().itemsFromYearly()
tR += await tp.user.journal().itemsFromMonthly()
tR += await tp.user.journal().itemsFromWeekly()
tR += await tp.user.journal().itemsFromEvents()
-%>
   + health:: exercise:
   + health:: abed:

So if you were to run the template on July 11th, the output would be:

# 2022.07.11 (Mon)
   + health:: arise:
   + health:: weight:
   + work:: Weep because a new work week is starting
   + work:: Weekly one-on-one with pointy-haired boss @ 10:00
   + health:: exercise:
   + health:: abed:

The above may be more technical than you’d like to get into, and that’s ok.

Hopefully you’ll get lots of options in here, both super customizable and general like @ninjineer 's and ones less technical, ones using different plugins, etc. I’m really curious what people do!
I use the obsidian-tasks plugin’s recurring task feature for some of my chores that need to be done on a particular day of the week (take the trash out the night before it gets picked up, etc.).

If you have only a small number of things that differ per day, you could write them all out in one template file and then use if statements based on the day of the week. Or you could instead make a MondayTemplate.md and a TuesdayTemplate.md and use tp.file.include inside your if statement instead. There are a couple pages in the templater documentation with examples of it-statements, even though the pages are about something else. The bottom of this page has a pretty simple if statement example and the top half of the examples section here is another.

As a quick example to put in this post,

<%* if (tp.date.now("ddd") === "Mon") { -%>
- [ ] Laundry
<%* } else { -%>
- [ ] Some other chore or task
<%* } -%>

A little tedious to write, but hopefully easy for your future self to edit and add to!
Good luck!