(send_date: date)
return DateSpan(startdate, enddate)
Returns a DateSpan from last week Monday to last week Sunday

    ISO 8601 has Monday as Day 1 and Sunday as Day 7
Returns a DateSpan from last week Monday to last week Sunday
Returns a DateSpan from last week Monday to last week Sunday
def get_previous_week(send_date: date) -> DateSpan:
    """
    Returns a DateSpan from last week Monday to last week Sunday

    ISO 8601 has Monday as Day 1 and Sunday as Day 7
    """
    # monday.weekday() == 0, so subtracting send_date.weekday() from
    # send_date will always give you the Monday at the start of the week
    monday = send_date - timedelta(days=send_date.weekday())
    startdate = monday - timedelta(days=7)
    enddate = monday - timedelta(days=1)
    return DateSpan(startdate, enddate)
def get_previous_week ( send_date : date ) -> DateSpan : # monday.weekday() == 0, so subtracting send_date.weekday() from # send_date will always give you the Monday at the start of the week monday = send_date - timedelta ( days = send_date . weekday ( ) ) startdate = monday - timedelta ( days = 7 ) enddate = monday - timedelta ( days = 1 ) return DateSpan ( startdate , enddate )