Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
last.isoformat() solution in Clear category for The First Working Day by flpo
from datetime import date, timedelta
def vacation(first, days):
first = date(*map(int, first.split('-')))
last = first + timedelta(days=days)
if last.weekday() in (5, 6):
last += timedelta(days=(7 - last.weekday()))
return last.isoformat()
Aug. 23, 2018
Comments: