Forked from dannberg/obsidian-daily-note-template.txt
Last active
March 19, 2025 15:29
-
-
Save gd03champ/6c8fe7739161c731859298b1bc96cfa0 to your computer and use it in GitHub Desktop.
Dann Berg's Daily Note Template for Obsidian. Uses Dataview & Templater plugins. Should be saved as a Markdown file in Obsidian. Read the full tour: https://dannb.org/blog/2022/obsidian-daily-note-template/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
created: | |
- <% tp.file.creation_date() %> | |
tags: | |
- DailyNote | |
--- | |
# <% moment(tp.file.title,'DD-dddd').format("dddd, MMMM DD, YYYY") %> | |
<< [[Purpose/Routine/Daily/<%fileDate = moment(tp.file.title, 'DD-dddd').subtract(1, 'd').format('YYYY/MM-MMMM') %>/<%fileDate = moment(tp.file.title, 'DD-dddd').subtract(1, 'd').format('DD-dddd') %>|Yesterday]] | [[Purpose/Routine/Daily/<% fileDate = moment(tp.file.title, 'DD-dddd').add(1, 'd').format('YYYY/MM-MMMM') %>/<% fileDate = moment(tp.file.title, 'DD-dddd').add(1, 'd').format('DD-dddd') %>|Tomorrow]] >> | |
--- | |
### π Daily Questions | |
##### π Last night, after work, I... | |
- | |
##### π One thing I'm excited about right now is... | |
- | |
##### π One+ thing I plan to accomplish today is... | |
- [ ] | |
##### π One thing I'm struggling with today is... | |
- | |
--- | |
# π Notes | |
- <% tp.file.cursor() %> | |
--- | |
### Notes created today | |
```dataview | |
List FROM "" WHERE file.cday = date("<% moment(tp.file.title,'DD-dddd').format("YYYY-MM-DD") %>") SORT file.ctime asc | |
``` | |
### Notes last touched today | |
```dataview | |
List FROM "" WHERE file.mday = date("<% moment(tp.file.title,'DD-dddd').format("YYYY-MM-DD") %>") SORT file.mtime asc | |
``` |
Thanks for this amazing template, and the page that walks through it. I have no idea what I might be doing wrong but I keep getting invalid date at the top variable. Any idea where i could look?
For some of you, the parsing error is because it can't parse the javascript.
But frankly, you don't need JS to do this, dataview already has everything you need:
List FROM ""
WHERE file.cday = this.file.day
SORT file.ctime asc
It won't return results on the template since it doesn't have a title that's made of a date, of course.
For notes edited that day, it's good to also exclude those created today, since they're already in the above section 100% of the time:
List FROM ""
WHERE
file.mday = this.file.day AND
file.cday < this.file.day
SORT file.mtime asc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you for sharing