What I’m trying to do
I created a weekly template (to use with Templater, Calendar, and Periodic Notes plugins). Every time I click on a week number in a Calendar it creates a new note for that week called “Wk 24-10 Mar” (as in YY-Week number Month).
1. Creating Links to all days of the week:
I’d love to list all days from that week as links to those notes: my daily notes are located in a folder called “Daily”, so I used this to extract weekday from a title and generate each of the days:
[[Daily/<%+ tp.date.weekday("YYYY-MM-DD", 0, tp.file.title, "YYYY-[W]ww") %>]]
It does retrieve the dates all correctly. But does NOT create links, since it thinks an actual path is the code, not the displayed result…
How do I make turn those dates into links automatically?
2. I wanted the week number listed as a property.
It does list the date accurately, but in edit mode still shows the code… which, I think, breaks my next script…
week: <%+ tp.file.title.split(' ')[1] %>
3. In same weekly template, I am trying to have a habit tracker overview:
That’s where I use that property “week: 24-10” I was asking about in my second question.
Using Dataview table, I list this
table without id
file.link AS "Day",
choice(Meditation, "👍","❌") AS "Meditate",
choice(Quote, "👍","❌") AS "Quote",
Goals AS "🥅Gls!"
from "Daily"
where week = "24-10"
sort file.name ASC
If I enter the week number manually as I do in this sample (both in each daily note property and in this weekly query) - it works. If I try to generate the numbers dynamically via same code as above or try to access the property as in “this.week” - dataview doesn’t return me any results.
How do I do this right?
Thank you so much for your help!!