# *On This Day* feature for Daily Obsidian notes
This is a quick tip for anyone who keeps daily notes in the YYYY-MM-DD format and wants an *On This Day* feature that shows entries from the same date in other years in their daily journal:
![[Pasted image 20250904054632.png|On This Day feature inside a Daily Note]]
Obsidian Bases code:
```text
filters:
and:
- file.inFolder("Journal 📝/")
- file.hasTag("journal/daily")
formulas:
note_year: file.name.slice(0, 4)
note_month: file.name.slice(5, 7)
note_day: file.name.slice(8, 10)
current_year: "{{date:YYYY}}"
current_month: "{{date:MM}}"
current_day: "{{date:DD}}"
properties:
file.name:
displayName: On This Day
views:
- type: table
name: On This Day
filters:
and:
- formula.current_year != formula.note_year
- formula.current_month == formula.note_month
- formula.current_day == formula.note_day
order:
- file.name
sort:
- property: file.name
direction: DESC
formula.on_this_day:
displayName: On This Day
```
Use the CSS class `hide-bases-header` to hide the base header:
```css
.hide-bases-header .bases-header {
display: none;
}
```
## Other Queries
Here are some more Obsidian base queries that show the current and previous months' habits for inspiration:
### Current Month
```
filters:
and:
- file.hasTag("journal/daily")
formulas:
reading: |
if(note.habits.contains("reading"), true, null)
workout: |
if(note.habits.contains("workout"), true, null)
current_year: today().format("YYYY")
current_month: today().format("MM")
current_month_folder: |
["Journal 📝", formula.current_year, formula.current_month].join("/")
extra_tags: |
tags.filter(
value != "journal/daily"
)
views:
- type: table
name: Table
filters:
and:
- file.inFolder(formula.current_month_folder)
order:
- file.name
- mood
- formula.reading
- formula.workout
- formula.extra_tags
sort:
- property: file.name
direction: DESC
columnSize:
file.name: 125
```
### Previous Month
```
filters:
and:
- file.hasTag("journal/daily")
formulas:
reading: |
if(note.habits.contains("reading"), true, null)
workout: |
if(note.habits.contains("workout"), true, null)
previous_note_year: (today() - "1 month").format("YYYY")
previous_note_month: (today() - "1 month").format("MM")
previous_note_month_folder: |
["Journal 📝", formula.previous_note_year, formula.previous_note_month].join("/")
extra_tags: |
tags.filter(
value != "journal/daily"
)
views:
- type: table
name: Table
filters:
and:
- file.inFolder(formula.previous_note_month_folder)
order:
- file.name
- mood
- formula.reading
- formula.workout
- formula.extra_tags
sort:
- property: file.name
direction: DESC
columnSize:
file.name: 125
```