I’ve been doing my primary journaling in Day One for years, and one of its best features is “On This Day” where it shows you other entries you created on the same month and date for all the past years you’ve kept a journal. I really wanted to have the same thing in Obsidian, so I added a section to my “Daily Note Template” that embeds a query for the date in question.
The section looks like this, but the embedded query does most of the heavy lifting:
---
## On This Day
```query
file:"{{date:-MM-DD}}"
```
I’d really like to use the Daily Notes in Obsidian for my principal journaling, for linking my thinking and whatnot, but I’m very attached to Day One’s book printing service that allows me to print physical volumes of my journals after every year. If anyone knows a convenient way to automate import of Obsidian Daily Notes into Day One, I sure would appreciate it!
This will remove the current year’s note (in other words, the note you’re currently in).
Side note: @ianlhayes How did you get the code block to work inside the code block here on the forum? Mine keeps terminating on the first set of tick marks.
Thank you for this! I’m still trying to wrap my head around the different plugins I need to enable in order to have the dates automatically entered. What methods are you using to pull the current date, etc. into dataview?
Okay, it turns out I have a problem. My search query doesn’t find other entries from the same day that I have imported in the past, e.g. I have multiple entries from 2019-05-24 that are listed as 2019-05-24a, 2019-05-24b, etc. Is there a way I can word my query to capture possible suffixes as well? Right now my query only finds the numeric entries and so my embedded query only shows one entry per day.
I use Templater in order to create the dates for the Time of Creation, and it’s Last Modification. These are the lines for the On this day Info Admonition and for the lines of dataviewjs needed to scan all journal entries starting from 2022 (when I started using Obsidian) and ending in 2122 (99 years from now) to find journal entries which it’s title month and day matches with that of the current journal entry’s title’s month and day.
I have decided to use the Title because, occasionally, the Creation Date is not the same as the File’s Title which is also a Date.
Here are the lines of Dataviewjs and Info Admonition:
title: On this day:
```dataviewjs
// set your own minimum year and the path to your journals (if applicable)
const minYear = 2022;
const maxYear = 2122;
const journalPath = 'Calendar/Journals';
const rangeOfYears = (start, end) => Array(end - start + 1)
.fill(start)
.map((year, index) => year + index)
const d = new Date(dv.date(dv.current().file.name));
const currentYear = d.getFullYear();
const availableYears = rangeOfYears(minYear, maxYear);
const month = ("0" + (d.getMonth() + 1)).slice(-2);
const day = ("0" + (d.getDate())).slice(-2);
const dateString = month + '-' + day;
availableYears.forEach((y) => {
var note = dv.page(`${journalPath}/${y}-${dateString}`);
if (note && y !== currentYear) {
dv.el('div', `[[${note.file.path}|${y}]]`);
}
});