But expand your tests, because I think something even more funky is going on.
I removed the time just to experiment
`= date(2023-01-06).week` = 1
`= date(2023-01-07).week` = 2 (so far the same as you)
`= date(2023-07-12).week` = 2 (wat?)
`= date(2023-03-23).week` = 4
`= date(2023-02-01).week` = 1
`= date(2023-11-20).week` = 3
But I don’t know where to find the documentation for the syntax. So I don’t know if this is a dv week parsing bug, or a mismatched syntax. Or if it’s just returning the week of the current month of the date object (I don’t think so. 2023-11-20 should be 4 in that case, I think).
(In either case, I do see the off-by-one like you.)
You can retrieve various components of a date via indexing: date.year, date.month, date.day, date.hour, date.minute, date.second, date.week, date.weekyear.
It seems that date.weekyear should be used. Yes? Correlates with the week numbers given in the calendar.
Copy and ‘paste and match style / paste as plain text’ the text below into a note to test.
Yeah, date.weekyear works for what I wanted. It was just hard for me to understand why the week started on Monday because I always saw on calendars it starting on Sundays, and I didn’t find much documentation about these week.<function>, so it is hard to understand what the return value will be.