Commit 1bb4c840 authored by Aurore Mo-Ma's avatar Aurore Mo-Ma

On a le droit de naître le 29 février #céciliasrequest

parent 3e17aee6
......@@ -14,7 +14,13 @@ def execute(macro, text):
year, month, day = text.split(",")
y, m, d = int(year), int(month), int(day)
now = datetime.datetime(*time.localtime()[:6])
birthdate = datetime.datetime(now.year, m, d)
birthdate = now
if m==2 and d==29:
birthdate = datetime.datetime(now.year, 3, 01)
if now.month==2 and now.day==29:
now = datetime.datetime(now.year, 3, 01)
else:
birthdate = datetime.datetime(now.year, m, d)
age = now.year - y
if now < birthdate:
age -= 1
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment