Refactor time splitter, support computing of dates for time entries

This commit is contained in:
2024-04-16 23:21:34 +02:00
parent 2cdfa2e948
commit bd775bec45
7 changed files with 1006 additions and 534 deletions

View File

@@ -82,14 +82,14 @@ final class NodaConsolidatedNamesForPersinst extends NodaConsolidatedNamesAbstra
$dateString = rtrim($parts[1], ')'); //
if (!empty($dates = NodaTimeSplitter::is_timespan($dateString))
&& $dates[0] !== '?'
&& $dates[1] !== '?'
&& intval($dates[1]) - intval($dates[0]) < 150
&& $dates->start_year !== '?'
&& $dates->end_year !== '?'
&& intval($dates->end_year) - intval($dates->start_year) < 150
) {
return [
'name' => $nameOnly,
'birth' => $dates[0],
'death' => $dates[1],
'birth' => $dates->start_year,
'death' => $dates->end_year,
];
}