Time splitter: Handle first/second half

Close #31
This commit is contained in:
2025-04-05 00:09:39 +02:00
parent 8491b62a83
commit e8edb4a459
3 changed files with 25 additions and 2 deletions

View File

@ -1101,6 +1101,15 @@ final class NodaTimeSplitter {
if (empty($datum)) return '';
if (\preg_match("/^1\.\ (Halbjahr|Hälfte)\ [0-9]{4}$/", $datum)) {
$year = substr($datum, -4);
return "Januar $year-Juni $year";
}
if (\preg_match("/^2\.\ (Halbjahr|Hälfte)\ [0-9]{4}$/", $datum)) {
$year = substr($datum, -4);
return "Juli $year-Dezember $year";
}
$inputLength = strlen($datum);
// Hungarian year and month until month