What I’m trying to do
I’m trying to assign the week number to daily journal notes and it’s working except Mondays are assigned to the prior week. For example, Monday 9/23/2024 gets assigned Week 38 instead of 39. Monday 9/30/2024 gets week 39 instead of 40. Tuesday and the other days work fine.
I’m using Templater, Periodic Notes and Calendar.
My goal is to surface a list of the daily notes from the week in the weekly journal entry with a few key properties to help me reflect on the week. I’m very close and feel this will be a really helpful step to my journal process and reflection. Any help greatly appreciated.
This is the code I’m using.
<%*
const thisDay = window.moment(new Date(tp.file.title));
const thisWeek = thisDay.format("YYYY-[W]ww")
-%>
---
week: <% thisWeek %>
---
Things I have tried
In calendar I’ve set the week to start on Monday. The Locale is set to En/US. I’ve tried searching the forums and googling. I checked Templater and Moment docs but can’t find anything.
Here is a screenshot of the result when I click Monday 9/30/2024 from calendar and create a new daily note. You can see the wrong week in the properties.