-
Star
(225)
You must be signed in to star a gist -
Fork
(49)
You must be signed in to fork a gist
-
-
Save dannberg/48ea2ba3fc0abdf3f219c6ad8bc78eb6 to your computer and use it in GitHub Desktop.
| --- | |
| created: <% tp.file.creation_date() %> | |
| --- | |
| tags:: [[+Daily Notes]] | |
| # <% moment(tp.file.title,'YYYY-MM-DD').format("dddd, MMMM DD, YYYY") %> | |
| << [[Timestamps/<% tp.date.now("YYYY", -1) %>/<% tp.date.now("MM-MMMM", -1) %>/<% tp.date.now("YYYY-MM-DD-dddd", -1) %>|Yesterday]] | [[Timestamps/<% tp.date.now("YYYY", 1) %>/<% tp.date.now("MM-MMMM", 1) %>/<% tp.date.now("YYYY-MM-DD-dddd", 1) %>|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("<%tp.date.now("YYYY-MM-DD")%>") SORT file.ctime asc | |
| ``` | |
| ### Notes last touched today | |
| ```dataview | |
| List FROM "" WHERE file.mday = date("<%tp.date.now("YYYY-MM-DD")%>") SORT file.mtime asc | |
| ``` |
<%*
const d = moment(tp.file.title, 'YYYY-MM-DD');
const prev = d.clone().subtract(1, 'days');
const next = d.clone().add(1, 'days');
tR += `# ${d.format("dddd, MMMM DD, YYYY")}
<< [[Timestamps/${prev.format("YYYY")}/${prev.format("MM-MMMM")}/${prev.format("YYYY-MM-DD-dddd")}|[previous day](https://gist.github.com/dannberg/Timestamps/$%7Bprev.format(%22YYYY%22)%7D/$%7Bprev.format(%22MM-MMMM%22)%7D/$%7Bprev.format(%22YYYY-MM-DD-dddd%22)%7D)]] | [[Timestamps/${next.format("YYYY")}/${next.format("MM-MMMM")}/${next.format("YYYY-MM-DD-dddd")}|[next day](https://gist.github.com/dannberg/Timestamps/$%7Bnext.format(%22YYYY%22)%7D/$%7Bnext.format(%22MM-MMMM%22)%7D/$%7Bnext.format(%22YYYY-MM-DD-dddd%22)%7D)]] >>`;
-%>
I changed the navigation links to actually work for advancing through the daily notes. it gets the date from the file title (parsed via moment(tp.file.title, 'YYYY-MM-DD')), then computes yesterday and tomorrow by cloning that moment and subtracting/adding one day.
Date parsing
tp.file.title gives Templater the current note's filename (e.g. 2026-03-18). moment() parses that string into a moment object using the YYYY-MM-DD format, so all subsequent date math is based on the actual note you're in β not "today."
Navigation link construction
For each neighbor (prev/next), it builds an Obsidian wikilink in the format:
[[Timestamps/YYYY/MM-MMMM/YYYY-MM-DD-dddd|display text]]
This mirrors your folder structure exactly β year at the top level, then a MM-MMMM subfolder (e.g. 03-March), then the full dated filename with weekday appended.
How to fix incorrect "Tomorrow" and "Yesterday" links:
<< [[Timestamps/<% tp.date.now("YYYY", -1, tp.file.title, "YYYY-MM-DD") %>/<% tp.date.now("MM-MMMM", -1, tp.file.title, "YYYY-MM-DD") %>/<% tp.date.now("YYYY-MM-DD-dddd", -1, tp.file.title, "YYYY-MM-DD") %>|Yesterday]] | [[Timestamps/<% tp.date.now("YYYY", 1, tp.file.title, "YYYY-MM-DD") %>/<% tp.date.now("MM-MMMM", 1, tp.file.title, "YYYY-MM-DD") %>/<% tp.date.now("YYYY-MM-DD-dddd", 1, tp.file.title, "YYYY-MM-DD") %>|Tomorrow]] >>
@dannberg : Thank you very much for the efforts you have put in to create these documents. Much appreciated.
I was facing the parsing error while using the code you provided. Even after replacing the " with ' in the code, it didn't work (Screenshot attached). I threw it into ChatGPT and it gave me the following code which worked for me.
Solution that worked for me
Notes created today
LIST WHERE file.cday = date(today) SORT file.ctime ASC
Notes last touched today
LIST WHERE file.cday >= date(today) AND file.cday < date(today) + dur(1 day) SORT file.ctime ASC