What I’m trying to do
I want to create a template for planning class hours. I use meta data to include the rhythm (like every week) and the start date of a course. With this information I wrote some inline DQLs to generate headers for each class hour. So I have something like:
rhythm : 7 days
=dateformat(this.startdate+ 0 * this.rhythm ,"W")-
=dateformat(this.startdate+ 0 * this.rhythm ,"EEE, dd.MM.yyyy")
=dateformat(this.startdate+ 1 * this.rhythm ,"W")-
=dateformat(this.startdate+ 1 * this.rhythm ,"EEE, dd.MM.yyyy")
To get something like
KW 36 - Mo., 04.09.2023
KW 37 - Mo., 11.09.2023
However I run into problems for some durations and the result is not as expected (e.g. shows a Wednesday when it should always be a Monday).
KW 40 - Mi., 04.10.2023
Things I have tried
I “debugged” it a little and found out that the code does something strange when it comes e.g. to “4 * 7 days”:
=(4 * this.rhythm ).days
I believe somehow it is recognized as a month and that would be 30 days, even though I want it to be 4 * 7 days = 28 days. I tried to write the rythms as hours and other formats but I can’t get this to work.
Does anyone have an idea how to solve this? Thank you very much!