mirror of
https://github.com/openvk/openvk
synced 2024-12-23 00:51:03 +03:00
User: Age refactoring
Лапский, это вообще пиздец какой-то. Проще не додумался сделать?
This commit is contained in:
parent
f3791f6478
commit
fd2ef5fad5
4 changed files with 15 additions and 4 deletions
|
@ -322,6 +322,11 @@ class User extends RowModel
|
|||
return $this->getRecord()->birthday;
|
||||
}
|
||||
|
||||
function getAge(): ?int
|
||||
{
|
||||
return (int)floor((time() - $this->getBirthday()) / mktime(0, 0, 0, 1, 1, 1971));
|
||||
}
|
||||
|
||||
function updateNotificationOffset(): void
|
||||
{
|
||||
$this->stateChanges("notification_offset", time());
|
||||
|
|
|
@ -402,8 +402,7 @@
|
|||
<tr>
|
||||
<td class="label"><span class="nobold">{_"birth_date"}:</span></td>
|
||||
<td class="data">{date('d F Y',$user->getBirthday())},
|
||||
{date('m d') >= date('m d', $user->getBirthday()) ? date('Y') - date('Y', $user->getBirthday()) :
|
||||
(date('m d') < date('m d', $user->getBirthday()) ? date('Y') - date('Y', $user->getBirthday()) - 1)} {_"years"}</td>
|
||||
{tr("years", $user->getAge())}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
</tbody>
|
||||
|
|
|
@ -39,7 +39,9 @@
|
|||
"was_online_m" = "was online";
|
||||
/* For male and female */
|
||||
|
||||
"years" = "y.o";
|
||||
"years_zero" = "0 year old";
|
||||
"years_one" = "1 year old";
|
||||
"years_other" = "$1 years old";
|
||||
|
||||
"was_online_f" = "was online";
|
||||
"all_title" = "All";
|
||||
|
|
|
@ -45,9 +45,14 @@
|
|||
"no_information_provided" = "Информация отсутствует.";
|
||||
"deceased_person" = "Страница покойного человека";
|
||||
"none" = "отсутствует";
|
||||
"years" = "лет";
|
||||
"send" = "Отправить";
|
||||
|
||||
"years_zero" = "0 лет";
|
||||
"years_one" = "1 год";
|
||||
"years_few" = "$1 года фю";
|
||||
"years_many" = "$1 лет мани";
|
||||
"years_other" = "$1 лет";
|
||||
|
||||
"relationship" = "Семейное положение";
|
||||
|
||||
"relationship_0" = "Не выбрано";
|
||||
|
|
Loading…
Reference in a new issue