What I’m trying to do
Hi everyone. I just went full Obsidian after spending a year using it alongside Todoist (Tasks), Daylio (Journal) and Loop Habits (Habits).
So I’m using a combinaison of Tasks, Calendar, Periodic Notes, Templater and Dataview to create myself Daily, Weekly, Monthly, Quarterly and Yearly notes.
I thought about using Archiver as well but it seems like Tasks is doing a great job at queriying done tasks, so I’m not using it. But I’m having issue using Templater instead of relying on relative date from Task plugin.
I’m done with my Daily Note template that I show at the end of my post.
I used the relative date using “today” in my task queries, but changed because if I was on another Daily Note, let’s say yesterday, it wasn’t showing yesterday done note, but today’s one.
So I went from :
done on today
To :
done on <% moment(tp.file.title, "YYYY-MM-DD").format("YYYY-MM-DD") %>
My issue is that while obsidian tasks understand my standard week number for querying notes done during this week, I don’t know how to querry my habits done during the week given the week number.
Here are my periodic notes formats :
- Daily : YYYY-MM-DD
- Weekly : gggg-[W]ww
- Monthly : YYYY-MM
- Quarterly : YYYY-[Q]Q
- Yearly : YYYY
Thanks in advance !
Things I have tried
I tried using different combinaison of ``this.file.day.weekyear` but the querry doesn’t give me anything.
My Daily Note template
title: ‘<% moment(tp.file.title, “YYYY-MM-DD”).format(“YYYY-MM-DD”) %>’
date created:
date modified:
tags: daily-notes
aliases:
source:
type:
author:
date:
<% moment(tp.file.title, “YYYY-MM-DD”).format(“YYYY-MM-DD”) %>
<%*
const currentMoment = moment(tp.file.title, “YYYY-MM-DD”);
const hash = '# ';
const slash = ’ / ';
const pipe = ’ | ‘;
const leftAngle = ‘❮ ‘;
const rightAngle = ’ ❯’;
tR += leftAngle;
tR += ‘[[’ + currentMoment.format(‘YYYY’) + ‘]]’ + slash;
tR += ‘[[’ + currentMoment.format(‘YYYY-[Q]Q|[Q]Q’) + ‘]]’ + slash;
tR += ‘[[’ + currentMoment.format(‘YYYY-MM|MMMM’) + ‘]]’ + slash;
tR += ‘[[’ + currentMoment.format(‘gggg-[W]ww’) + ‘|’ + currentMoment.format(’[Week] ww’) + ‘]]’;
tR += rightAngle;
tR += ‘\n’;
tR += ‘\n’;
tR += leftAngle;
currentMoment.add(-1,‘days’);
tR += ‘[[’ + currentMoment.format(‘YYYY-MM-DD’) + ‘]]’ + pipe;
currentMoment.add(1,‘days’);
tR += currentMoment.format(‘YYYY-MM-DD’) + pipe;
currentMoment.add(1,‘days’);
tR += ‘[[’ + currentMoment.format(‘YYYY-MM-DD’) + ‘]]’;
currentMoment.add(-1,‘days’);
tR += rightAngle;
%>
[!Quote]+ Quote of the Day
<% tp.web.daily_quote() %>
Brain Dump - Today Notes
Overdue
not done
due before <% moment(tp.file.title, "YYYY-MM-DD").format("YYYY-MM-DD") %>
Do Today
not done
due <% moment(tp.file.title, "YYYY-MM-DD").format("YYYY-MM-DD") %>
Upcoming
not done
due after <% moment(tp.file.title, "YYYY-MM-DD").format("YYYY-MM-DD") %>
due before <% moment(tp.file.title, "YYYY-MM-DD").add(10,'days').format("YYYY-MM-DD") %>
short mode
hide edit button
hide backlink
Next Actions
not done
(created before <% moment(tp.file.title, "YYYY-MM-DD").format("YYYY-MM-DD") %>) OR (created on <% moment(tp.file.title, "YYYY-MM-DD").format("YYYY-MM-DD") %>)
tags include #next
Waiting For
not done
(created before <% moment(tp.file.title, "YYYY-MM-DD").format("YYYY-MM-DD") %>) OR (created on <% moment(tp.file.title, "YYYY-MM-DD").format("YYYY-MM-DD") %>)
tags include #waiting
short mode
Delegated
not done
(created before <% moment(tp.file.title, "YYYY-MM-DD").format("YYYY-MM-DD") %>) OR (created on <% moment(tp.file.title, "YYYY-MM-DD").format("YYYY-MM-DD") %>)
tags include #delegated
short mode
Task Log
done on <% moment(tp.file.title, "YYYY-MM-DD").format("YYYY-MM-DD") %>
Habits
Morning water::
Mobility::
Meditation::
Stretching::
Journal
My Weekly note template
title: ‘<% moment(tp.file.title, “gggg-[W]ww”).format(“gggg-[W]ww”) %>’
date created:
date modified:
tags: weekly-notes
aliases:
source:
type:
author:
date:
<% moment(tp.file.title, “gggg-[W]ww”).format(“gggg-[W]ww”) %>
Task Log
done in <% moment(tp.file.title, "gggg-[W]ww").format("gggg-[W]ww") %>
Habits
TABLE WITHOUT ID
file.link as Date,
choice("Morning water"=1,"✅","❌") as "Morning Water",
choice("Mobility"=1,"✅","❌") as "Mobility",
choice("Meditation"=1,"✅","❌") as "Meditation",
choice("Stretching"=1,"✅","❌") as "Stretching"
FROM "-Daily-Notes"
WHERE file.day.weekyear = "<% moment(tp.file.title, "gggg-[W]ww").format("gggg-[W]ww") %>"
SORT file.day ASC