Compare commits
No commits in common. "natally-patch-2" and "main" have entirely different histories.
natally-pa
...
main
@ -1,19 +0,0 @@
|
|||||||
import datetime
|
|
||||||
|
|
||||||
def get_last_friday(date_string):
|
|
||||||
parts = date_string.split("/")
|
|
||||||
mounth = int(части[0])
|
|
||||||
year = int(части[1])
|
|
||||||
if mounth == 12:
|
|
||||||
first = datetime.data(year +1,1,1)
|
|
||||||
else:
|
|
||||||
first = datetime.date(year,mounth+1,1)
|
|
||||||
last = first - datetime.timedelta(days=1)
|
|
||||||
now = last
|
|
||||||
while True:
|
|
||||||
if now.isoweekday() ==5:
|
|
||||||
break
|
|
||||||
else:
|
|
||||||
now = now - datetime.timedelta(days=1)
|
|
||||||
result = now.strftime("%d.%m.%Y")
|
|
||||||
return result
|
|
||||||
Loading…
Reference in New Issue
Block a user