mirror of
https://github.com/openvk/openvk
synced 2025-07-05 23:39:53 +03:00
API: add field bdate to users
This commit is contained in:
parent
317945eabc
commit
ad94b770e1
1 changed files with 26 additions and 0 deletions
|
@ -317,6 +317,32 @@ final class Users extends VKAPIRequestHandler
|
|||
|
||||
$response[$i]->custom_fields = $append_array;
|
||||
break;
|
||||
case "bdate":
|
||||
if (!$canView) {
|
||||
$response[$i]->bdate = "01.01.1970";
|
||||
break;
|
||||
}
|
||||
$visibility = $usr->getBirthdayPrivacy();
|
||||
$response[$i]->bdate_visibility = $visibility;
|
||||
|
||||
$birthday = $usr->getBirthday();
|
||||
if ($birthday) {
|
||||
switch ($visibility) {
|
||||
case 1:
|
||||
$response[$i]->bdate = $birthday->format('%d.%m');
|
||||
break;
|
||||
case 2:
|
||||
$response[$i]->bdate = $birthday->format('%d.%m.%Y');
|
||||
break;
|
||||
case 0:
|
||||
default:
|
||||
$response[$i]->bdate = null;
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
$response[$i]->bdate = null;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue