age format
This commit is contained in:
@@ -104,6 +104,16 @@ class ResultFormatter extends Model
|
||||
|
||||
return 'default.svg';
|
||||
}
|
||||
|
||||
function GetFamilyAge($age,$year,$month){
|
||||
$currAge= $age;
|
||||
if ($year > 0 && $month > 0 ){
|
||||
$bdate="$year/$month/1";
|
||||
$currAge = date_diff(date_create($bdate), date_create('now'))->y;
|
||||
}
|
||||
return $currAge;
|
||||
}
|
||||
|
||||
public function processOutJson($in, $out) {
|
||||
|
||||
|
||||
@@ -396,7 +406,7 @@ class ResultFormatter extends Model
|
||||
"family_uid" => $out["uid_${key}"],
|
||||
"firstname" => $out["firstname_${key}"],
|
||||
"lastname" => $out["lastname_${key}"],
|
||||
"age" => $out["age_${key}"],
|
||||
"age" => $this->GetFamilyAge( $out["age_${key}"],$out["year_${key}"],$out["month_${key}"]),
|
||||
"year" => $out["year_${key}"],
|
||||
"month" => $out["month_${key}"],
|
||||
"last_login" => $out["last_login_${key}"],
|
||||
|
||||
Reference in New Issue
Block a user