'Y', 10 => 'M Y', 11 => 'j. M Y', 12 => 'j. M Y - G:00', 13 => 'j. M Y - G:i', 14 => 'j. M Y - G:i:s', ]; return $v->format($formats[$p]); } } function wikidataFormat ($id, $lang) { $ret = '' . wikidataGetLabel($id, $lang) . ''; $birthDate = wikidataGetValues($id, 'P569'); $deathDate = wikidataGetValues($id, 'P570'); if (sizeof($birthDate) && sizeof($deathDate)) { $ret .= ' (' . wikidataFormatDate($birthDate[0], 11) . ' — ' . wikidataFormatDate($deathDate[0], 11) . ')'; } elseif (sizeof($birthDate)) { $ret .= ' (* ' . wikidataFormatDate($birthDate[0], 11) . ')'; } elseif (sizeof($deathDate)) { $ret .= ' († ' . wikidataFormatDate($birthDate[0], 11) . ')'; } $occupation = wikidataGetValues($id, 'P106'); if (sizeof($occupation)) { $ret .= ', ' . implode(', ', array_map( function ($value) use ($lang) { return wikidataGetLabel($value['id'], $lang); }, $occupation )); } return $ret; }