<%* let ISO_8601_SHORT_FMT = “YYYY-MM-DD”;
let today = moment();
let yesterday = moment(today).subtract(1, ‘d’);
let tomorrow = moment(today).add(1, ‘d’);
let this_week = moment(today).startOf(‘isoWeek’);
let this_week_num = today.isoWeek();
let last_week = moment(today).subtract(1, ‘w’).startOf(‘isoWeek’);
let last_week_num = last_week.isoWeek();
let next_week = moment(today).add(1, ‘w’).startOf(‘isoWeek’);
let next_week_num = next_week.isoWeek();
let week_delta = Math.abs(next_week_num-this_week_num); %>
Lesson Plans for the Week of [[<% tp.date.weekday(“YYYY-MM-DD”, 1) %>]]
[[<% tp.date.weekday(“YYYY-MM-DD”, 1) %>]]
01: Reading Lesson
15: Lecture
30: Inquiry Journal
45: Discussion
55: Dismissal
[[<% tp.date.weekday(“YYYY-MM-DD”, 2) %>]]
01: Reading Lesson
15: Lecture
30: Inquiry Journal
45: Discussion
55: Dismissal
[[<% tp.date.weekday(“YYYY-MM-DD”, 3) %>]]
01: Reading Lesson
15: Lecture
30: Inquiry Journal
45: Discussion
55: Dismissal
[[<% tp.date.weekday(“YYYY-MM-DD”, 4) %>]]
01: Reading Lesson
15: Lecture
30: Inquiry Journal
45: Discussion
55: Dismissal
[[<% tp.date.weekday(“YYYY-MM-DD”, 5) %>]]
01: Reading Lesson
15: Lecture
30: Inquiry Journal
45: Discussion
55: Dismissal
What I’m trying to do
I have no idea what I’m doing. I’m just trying to fill out the next week of dates. Should be easy but I’m way past rusty and ChatGPT doesn’t help if you don’t really know what you are doing in Obsidian coding.
You’ve got no idea what you’re trying to do? And you present us with stuff from ChatGPT, which you don’t know what does? How do you expect us to help you then?!
Let’s first of all take a step back, and get a clear idea of what is it you want the template to do? Which output do you want of a working template?
Secondly, do you know how to create templates, and how create notes using those templates? (And are you somewhat familiar with Templater templates, like you’re showing code from?)
Lastly (for now), please include markdown blocks (with our without other code blocks) within four backticks, like in ````, so that we see what’s your markdown attempts, and what’s your ordinary text. (Using four ticks in the forum posts, instead of three, will also allow any other code blocks to look nice in here)
let today = moment();
let next_week = moment(today).add(1, ‘w’).startOf(‘isoWeek’);
let nextmonday = next_week;
let nexttuesday = moment(nextmonday).add(1, ‘d’);
let nextwednesday = moment(nexttuesday).add(1,‘d’);
let nextthursday = moment(nextwednesday).add(1, ‘d’);
let nextfriday = moment(nextthursday).add(1, ‘d’);
No this doesn’t actually work. I get a parsing error and I don’t know how to troubleshoot that.
<%
let today = moment();
let next_week = moment(today).add(1, ‘w’).startOf(‘isoWeek’);
let nextmonday = next_week;
let nexttuesday = moment(nextmonday).add(1, ‘d’);
let nextwednesday = moment(nexttuesday).add(1,‘d’);
let nextthursday = moment(nextwednesday).add(1, ‘d’);
let nextfriday = moment(nextthursday).add(1, ‘d’);
I used someone else’s code and finally figured it out.
<%* let ISO_8601_SHORT_FMT = “YYYY-MM-DD”;
let today = moment();
let yesterday = moment(today).subtract(1, ‘d’);
let tomorrow = moment(today).add(1, ‘d’);
let this_week = moment(today).startOf(‘isoWeek’);
let this_week_num = today.isoWeek();
let last_week = moment(today).subtract(1, ‘w’).startOf(‘isoWeek’);
let last_week_num = last_week.isoWeek();
let next_week = moment(today).add(1, ‘w’).startOf(‘isoWeek’);
let next_week_num = next_week.isoWeek();
let week_delta = Math.abs(next_week_num-this_week_num); %>
Lessons plans for [[G6 <%next_week.format(ISO_8601_SHORT_FMT)%>]]