Skip to content

Commit 604f61a

Browse files
committed
Adds a comment about the need for week addition
1 parent b74a5aa commit 604f61a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Lib/_pydatetime.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2395,6 +2395,8 @@ def _isoweek1monday(year):
23952395
THURSDAY = 3
23962396
firstday = _ymd2ord(year, 1, 1)
23972397
firstweekday = (firstday + 6) % 7 # See weekday() above
2398+
# If the first weekday is after Thursday,
2399+
# ISO week 1 doesn't start until the next Monday
23982400
week1monday = firstday - firstweekday
23992401
if firstweekday > THURSDAY:
24002402
week1monday += 7

0 commit comments

Comments
 (0)