Удалить last_friday_datetime.py
This commit is contained in:
parent
62917a9589
commit
8e98abdda4
@ -1,12 +0,0 @@
|
||||
from datetime import datetime, timedelta
|
||||
|
||||
def get_last_friday(a: str) -> str:
|
||||
date = datetime.strptime(a, "%m/%Y").date()
|
||||
next_month = date.replace(day=28) + timedelta(days=7)
|
||||
last_day = next_month - timedelta(days=next_month.day)
|
||||
|
||||
# Идем назад до пятницы
|
||||
while last_day.weekday() != 4:
|
||||
last_day -= timedelta(days=1)
|
||||
|
||||
return last_day.strftime("%d.%m.%Y")
|
||||
Loading…
Reference in New Issue
Block a user