MCPcopy Index your code
hub / github.com/python/cpython / yeardatescalendar

Method yeardatescalendar

Lib/calendar.py:319–327  ·  view source on GitHub ↗

Return the data for the specified year ready for formatting. The return value is a list of month rows. Each month row contains up to width months. Each month contains between 4 and 6 weeks and each week contains 1-7 days. Days are datetime.date objects.

(self, year, width=3)

Source from the content-addressed store, hash-verified

317 return [ days[i:i+7] for i in range(0, len(days), 7) ]
318
319 def yeardatescalendar(self, year, width=3):
320 """
321 Return the data for the specified year ready for formatting. The return
322 value is a list of month rows. Each month row contains up to width months.
323 Each month contains between 4 and 6 weeks and each week contains 1-7
324 days. Days are datetime.date objects.
325 """
326 months = [self.monthdatescalendar(year, m) for m in Month]
327 return [months[i:i+width] for i in range(0, len(months), width) ]
328
329 def yeardays2calendar(self, year, width=3):
330 """

Callers 1

Calls 1

monthdatescalendarMethod · 0.95

Tested by 1