mirror of
https://github.com/openvk/openvk
synced 2024-11-11 01:19:53 +03:00
parent
4a7a37e200
commit
6ef1e533da
3 changed files with 6 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -135,7 +135,7 @@
|
|||
<span class="nobold">{_"birth_date"}: </span>
|
||||
</td>
|
||||
<td>
|
||||
<input max={date('Y-m-d')} name="birthday" value={gmdate("Y-m-d", $user->getBirthday())} type="date"/>
|
||||
<input max={date('Y-m-d')} name="birthday" value={$user->getBirthday()->format('%Y-%m-%d')} type="date"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
|
|
@ -402,10 +402,10 @@
|
|||
<td class="label"><span class="nobold">{_"politViews"}:</span></td>
|
||||
<td class="data">{var $pviews = $user->getPoliticalViews()}{_"politViews_$pviews"}</td>
|
||||
</tr>
|
||||
{if $user->getBirthday() > 0}
|
||||
{if $user->getBirthday()->timestamp() > 0}
|
||||
<tr>
|
||||
<td class="label"><span class="nobold">{_"birth_date"}:</span></td>
|
||||
<td class="data">{date('d F Y',$user->getBirthday())},
|
||||
<td class="data">{$user->getBirthday()->format('%e %B %Y')},
|
||||
{tr("years", $user->getAge())}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
|
|
Loading…
Reference in a new issue