781e1ea75a
The four Markdown files (README.md, tests/fixtures/ados2_items_by_module.md, tools/delivery/README.md, tools/delivery/README.repo.md) live in the outer repo under docs/ISSSTELEON; the delivery scripts no longer produce a README and the ADOS-2 expected values stay in the Python test.
10 lines
329 B
Python
10 lines
329 B
Python
import calendar
|
|
from datetime import date
|
|
|
|
|
|
def window_start(cutoff: date, months: int) -> date:
|
|
total = cutoff.year * 12 + cutoff.month - 1 - months
|
|
year, month = divmod(total, 12)
|
|
day = min(cutoff.day, calendar.monthrange(year, month + 1)[1])
|
|
return date.fromordinal(date(year, month + 1, day).toordinal() + 1)
|