I think my title describes what I’m looking for, basically a simple way to include things like “days since I last did x” or “days till y” in my notes, where that part of the note would reference a specific calendar date (I don’t necessarily need stored variables).
Would JavaScript via Templater or Data View make sense for this, for example? If so, what exactly do I need to do?
Hi. Can you clarify better with a typical example of what you want? Are you talking about tasks? Queries in daily note templates? A fixed date, durations from “today” date, …?
Only with an example is possible to indicate if Dataview or Templater works for what you want.
The solution also depends if this is an isolated need or if it’s a more structured request with implications in the way you compose your notes.
Let’s try the second case (a more ‘structured’ way).
Let’s say you have a note for your “December vacations” and other for your friend “John birthday”.
In these notes you need to create a field with the date. For dataview plugin you can create this field in two ways: in yaml frontmatter with the syntax key: value; or an inline-field with the syntax key:: value. (here I’ll use the second type of field - inline field)
December vacations
# December vacations
duedate:: 2021-12-20
---
This is my note about my next vacations in December.
John birthday
# John birthday
duedate:: 2022-01-15
---
This is my note about the next John birthday
Now, you can work with this data field in multiple ways.
Case 1
You want a main note with the “countdown” for important events. In particular, you want a list/table with a panoramic view to all the next ‘big’ dates.
You can create this query:
## Next events
```dataview
TABLE duedate, duedate - date(today) AS "Remaining days"
WHERE duedate AND duedate >= date(today)
```
This is the result (ignore the date format - it’s my os language):
Thank you for this incredibly detailed answer. This answered my question and taught me a lot more besides. I was just starting to explore Dataview after I posted this. Really inspired by the possibilities. Thanks again.