Enable parsing of months: 2020-01

This commit is contained in:
2020-09-27 17:10:17 +02:00
committed by Stefan Rohde-Enslin
parent baeb9ba72e
commit 91f435a2e4
2 changed files with 25 additions and 0 deletions

View File

@ -536,6 +536,18 @@ final class NodaTimeSplitter {
unset($start, $month);
}
}
// Intl': 2020-12
if (preg_match("/^[0-9][0-9][0-9][0-9]\-[0-9][0-9]$/", $datum)) { // German Y-m
$start = substr($datum, 0, 4);
$month = substr($datum, 5, 2);
if (intval($month) < 13) {
return [$start, $start, $month, "00", "+", ""];
}
else {
unset($start, $month);
}
}
// German MM.JJJJ
if (preg_match("/^[0-9][0-9]\.[0-9][0-9][0-9][0-9]$/", $datum)) { // German Y-m
$start = substr($datum, 3, 4);