Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Ordinals make the math easy solution in Clear category for Weekly Calendar by rossras
from typing import List
from datetime import date
def weekly_calendar(year: int, month: int, day: int, firstweekday: int) -> List[int]:
d = date(year, month, day)
start = d.toordinal() - (d.weekday()-firstweekday)%7
return [date.fromordinal(i).day for i in range(start, start+7)]
Sept. 5, 2020