Only allow splitting by international format if month < 13

This commit is contained in:
Joshua Ramon Enslin 2020-09-27 12:38:38 +02:00 committed by Stefan Rohde-Enslin
parent 48f3bd2c3f
commit de7968fbbd

View File

@ -528,8 +528,13 @@ final class NodaTimeSplitter {
if (preg_match("/^[0-9][0-9][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);
$day = substr($datum, 8, 2);
return [$start, $start, $month, $day, "+", ""];
if (intval($month) < 13) {
$day = substr($datum, 8, 2);
return [$start, $start, $month, $day, "+", ""];
}
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