Private
Public Access
1
0

removing date.today and replacing with timezone.now

This commit is contained in:
Sander Roosendaal
2021-08-09 20:30:38 +02:00
parent ef34af1770
commit 0438d3b396
5 changed files with 61 additions and 30 deletions

View File

@@ -347,7 +347,7 @@ from datetime import date
def calculate_age(born,today=None):
if not today:
today = date.today()
today = timezone.now()
if born:
try:
return today.year - born.year - ((today.month, today.day) < (born.month, born.day))