diff --git a/Web/Models/Entities/User.php b/Web/Models/Entities/User.php index 68896910..dfeabf5d 100644 --- a/Web/Models/Entities/User.php +++ b/Web/Models/Entities/User.php @@ -317,14 +317,14 @@ class User extends RowModel return $this->getRecord()->notification_offset; } - function getBirthday(): ?int + function getBirthday(): ?DateTime { - return $this->getRecord()->birthday; + return new DateTime($this->getRecord()->birthday); } function getAge(): ?int { - return (int)floor((time() - $this->getBirthday()) / mktime(0, 0, 0, 1, 1, 1971)); + return (int)floor((time() - $this->getBirthday()->timestamp()) / mktime(0, 0, 0, 1, 1, 1971)); } function get2faSecret(): ?string diff --git a/Web/Presenters/templates/User/Edit.xml b/Web/Presenters/templates/User/Edit.xml index 7ca9d209..74e364cb 100644 --- a/Web/Presenters/templates/User/Edit.xml +++ b/Web/Presenters/templates/User/Edit.xml @@ -135,7 +135,7 @@ {_"birth_date"}: