I use deltatime to subtract 12 weeks and get the exact date but from this date I have to recover on Friday. this means that if we subtract 12 weeks I have Monday January 3, I have to make a change to get Friday January 7.
Code exemple :
I use this code to get the initial date :
week_num_period = datetime.today()- timedelta(weeks=12)
week_start_perioddddd = week_num_period.strftime("%Y-%m-%d")
but from that date i need to get the friday of that week ! i tried with
week_start_period = next_day(week_start_perioddddd, 'Friday')
week_start_period
but next_day doesn't apply on str ! could someone help me ?