Lines Matching defs:week
459 def _isoweek_to_gregorian(year, week, day):
464 if not 0 < week < 53:
467 if week == 53:
476 raise ValueError(f"Invalid week: {week}")
482 day_offset = (week - 1) * 7 + (day - 1)
484 # Calculate the ordinal day for monday, week 1
994 def fromisocalendar(cls, year, week, day):
995 """Construct a date from the ISO year, week number and weekday.
998 return cls(*_isoweek_to_gregorian(year, week, day))
1165 "Return day of the week, where Monday == 0 ... Sunday == 6."
1168 # Day-of-the-week and week-of-the-year, according to ISO
1171 "Return day of the week, where Monday == 1 ... Sunday == 7."
1176 """Return a named tuple containing ISO year, week number, and weekday.
1178 The first ISO week of the year is the (Mon-Sun) week
1182 The first week is 1; Monday is 1 ... Sunday is 7.
1191 # Internally, week and day have origin 0
1192 week, day = divmod(today - week1monday, 7)
1193 if week < 0:
1196 week, day = divmod(today - week1monday, 7)
1197 elif week >= 52:
1200 week = 0
1201 return _IsoCalendarDate(year, week+1, day+1)
1286 def __new__(cls, year, week, weekday, /):
1287 return super().__new__(cls, (year, week, weekday))
1294 def week(self):
1308 f'(year={self[0]}, week={self[1]}, weekday={self[2]})')
2286 # Helper to calculate the day number of the Monday starting week 1