1
0
Fork 0
mirror of https://github.com/Oreolek/ifhub.club.git synced 2024-05-19 17:28:23 +03:00
This commit is contained in:
Mzhelskiy Maxim 2015-06-23 15:53:46 +07:00
parent f78408941d
commit 228958f1e3
2 changed files with 3 additions and 7 deletions

View file

@ -572,13 +572,8 @@ class ActionSettings extends Action
/**
* Проверяем дату рождения
*/
if (func_check(getRequestStr('profile_birthday_day'), 'id', 1,
2) and func_check(getRequestStr('profile_birthday_month'), 'id', 1,
2) and func_check(getRequestStr('profile_birthday_year'), 'id', 4, 4)
) {
$this->oUserCurrent->setProfileBirthday(date("Y-m-d H:i:s",
mktime(0, 0, 0, getRequestStr('profile_birthday_month'), getRequestStr('profile_birthday_day'),
getRequestStr('profile_birthday_year'))));
if (preg_match('#^(\d{1,2})\.(\d{1,2})\.(\d{4})$#', getRequestStr('profile_birthday'), $aMatch)) {
$this->oUserCurrent->setProfileBirthday(date("Y-m-d H:i:s", mktime(0, 0, 0, $aMatch[2], $aMatch[1], $aMatch[3])));
} else {
$this->oUserCurrent->setProfileBirthday(null);
}

View file

@ -62,6 +62,7 @@
{component 'field' template='date'
name = 'profile_birthday'
inputClasses = 'js-field-date-default'
value = {date_format date=$user->getProfileBirthday() format='j.n.Y'}
label = {lang name='user.settings.profile.fields.birthday.label'}}