MCPcopy Index your code
hub / github.com/RustPython/RustPython / _isoweek1monday

Function _isoweek1monday

Lib/_pydatetime.py:2390–2398  ·  view source on GitHub ↗
(year)

Source from the content-addressed store, hash-verified

2388
2389
2390def _isoweek1monday(year):
2391 # Helper to calculate the day number of the Monday starting week 1
2392 THURSDAY = 3
2393 firstday = _ymd2ord(year, 1, 1)
2394 firstweekday = (firstday + 6) % 7 # See weekday() above
2395 week1monday = firstday - firstweekday
2396 if firstweekday > THURSDAY:
2397 week1monday += 7
2398 return week1monday
2399
2400
2401class timezone(tzinfo):

Callers 2

_isoweek_to_gregorianFunction · 0.85
isocalendarMethod · 0.85

Calls 1

_ymd2ordFunction · 0.85

Tested by

no test coverage detected