Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
weekday() - firstweekday solution in Clear category for Weekly Calendar by flpo
from typing import List
import datetime
def weekly_calendar(year: int, month: int, day: int, firstweekday: int) -> List[int]:
date = datetime.date(year, month, day)
start = date - datetime.timedelta((date.weekday() - firstweekday) % 7)
return [(start + datetime.timedelta(i)).day for i in range(7)]
Oct. 3, 2020