Enable autotranslating of times 'after' a certain date

This commit is contained in:
2020-10-04 18:21:33 +02:00
committed by Stefan Rohde-Enslin
parent 5e90e5d3f2
commit c9a1a74bce
3 changed files with 119 additions and 2 deletions

View File

@ -578,10 +578,10 @@ final class NodaTimeSplitter {
$month = "0" . substr($datum, 0, 1);
return [$start, $start, $month, "00", "+", ""];
}
if (preg_match("/^[0-9]{4}\.[0-9]{2}$/", $datum)) { // Hungarian Y-m
if (preg_match("/^[0-9]{4}\.[0-9]{2}(\.|)$/", $datum)) { // Hungarian Y-m
$start = substr($datum, 0, 4);
$month = substr($datum, 5, 2);
return [$start, $start, $month, "00", "+", ""];
if (intval($month) < 13) return [$start, $start, $month, "00", "+", ""];
}
if (preg_match("/^[0-9]{4}\-[0-9]{2}$/", $datum)) { // Time spans: 1945-46
$start = substr($datum, 0, 4);