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

Method formatmonth

Lib/calendar.py:536–553  ·  view source on GitHub ↗

Return a formatted month as a table.

(self, theyear, themonth, withyear=True)

Source from the content-addressed store, hash-verified

534 return f'<tr><th colspan="7" class="{self.cssclass_month_head}">{s}</th></tr>'
535
536 def formatmonth(self, theyear, themonth, withyear=True):
537 """
538 Return a formatted month as a table.
539 """
540 v = []
541 a = v.append
542 a(f'<table class="{self.cssclass_month}">')
543 a('\n')
544 a(self.formatmonthname(theyear, themonth, withyear=withyear))
545 a('\n')
546 a(self.formatweekheader())
547 a('\n')
548 for week in self.monthdays2calendar(theyear, themonth):
549 a(self.formatweek(week))
550 a('\n')
551 a('</table>')
552 a('\n')
553 return ''.join(v)
554
555 def formatyear(self, theyear, width=3):
556 """

Callers 3

formatyearMethod · 0.95
formatmonthpageMethod · 0.95
mainFunction · 0.95

Calls 6

formatmonthnameMethod · 0.95
formatweekheaderMethod · 0.95
formatweekMethod · 0.95
monthdays2calendarMethod · 0.80
aClass · 0.50
joinMethod · 0.45

Tested by

no test coverage detected