From 0fd8734ea1ff367b3daac8c5ab77a829e6db9ef5 Mon Sep 17 00:00:00 2001 From: veselcraft Date: Sun, 16 Mar 2025 17:45:19 +0300 Subject: [PATCH] Revert "fix(age): calculation" This reverts commit 2abf4f0bd62a1b852b07e4ff7486f5ca28f733e0. --- Web/Models/Entities/User.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Web/Models/Entities/User.php b/Web/Models/Entities/User.php index 40da0dad..5532f2f8 100644 --- a/Web/Models/Entities/User.php +++ b/Web/Models/Entities/User.php @@ -524,10 +524,7 @@ class User extends RowModel public function getAge(): ?int { - $birthday = new \DateTime(); - $birthday->setTimestamp($this->getBirthday()->timestamp()); - $today = new \DateTime(); - return (int) $today->diff($birthday)->y; + return (int) floor((time() - $this->getBirthday()->timestamp()) / YEAR); } public function get2faSecret(): ?string