From 20ca453e342319cfd98bcf08fd409be47bd927b4 Mon Sep 17 00:00:00 2001 From: 0x7d5 <86822737+VladimirLapskiy@users.noreply.github.com> Date: Sat, 9 Oct 2021 19:40:20 +0500 Subject: [PATCH] User: bug fix with birthday --- Web/Presenters/templates/User/View.xml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Web/Presenters/templates/User/View.xml b/Web/Presenters/templates/User/View.xml index 948386f3..c3299000 100644 --- a/Web/Presenters/templates/User/View.xml +++ b/Web/Presenters/templates/User/View.xml @@ -384,10 +384,12 @@ {_"politViews"}: {var $pviews = $user->getPoliticalViews()}{_"politViews_$pviews"} - {if $user->getBirthday() != 0} + {if $user->getBirthday() > 0} {_"birth_date"}: - {date('d F Y',$user->getBirthday())}, {date('Y') - date('Y', $user->getBirthday())} {_"years"} + {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"} {/if}