Browse Source

fix age

master
Igor Elpin 2 years ago
parent
commit
517c760d4f
  1. 3
      humans/__init__.py
  2. 2
      templates/index.html

3
humans/__init__.py

@ -18,7 +18,8 @@ class AbstractHuman:
@property @property
def age(self) -> int: 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: if age>0:
return int(age) return int(age)
else: else:

2
templates/index.html

@ -51,7 +51,7 @@
<td> <td>
<div class="nes-balloon from-right is-dark"> <div class="nes-balloon from-right is-dark">
<p>Игорь Ельпин(говорит): <p>Игорь Ельпин(говорит):
Игорь Ельпин. Мужчина 1989-11-16 (33 полных лет) Игорь Ельпин. Мужчина 1989-11-16
</p> </p>
</div> </div>
<div class="nes-balloon from-right is-dark"> <div class="nes-balloon from-right is-dark">

Loading…
Cancel
Save