diff --git a/humans/__init__.py b/humans/__init__.py index d7bb016..e004fbf 100644 --- a/humans/__init__.py +++ b/humans/__init__.py @@ -18,7 +18,8 @@ class AbstractHuman: @property def age(self) -> int: - age=datetime.now().year-self.birthday.year + today=datetime.now() + age=today.year-self.birthday.year -((today.month, today.day) < (self.birthday.month, self.birthday.day)) if age>0: return int(age) else: diff --git a/templates/index.html b/templates/index.html index ea51449..915431c 100644 --- a/templates/index.html +++ b/templates/index.html @@ -51,7 +51,7 @@
Игорь Ельпин(говорит): - Игорь Ельпин. Мужчина 1989-11-16 (33 полных лет) + Игорь Ельпин. Мужчина 1989-11-16