Allow parsing of "1910-1925."

This commit is contained in:
Joshua Ramon Enslin 2020-09-24 17:59:15 +02:00 committed by Stefan Rohde-Enslin
parent 9f39437c6e
commit 7bc5bdf335

View File

@ -463,9 +463,11 @@ final class NodaTimeSplitter {
$datum = self::clean_input($datum);
if (preg_match("/^[0-9][0-9][0-9][0-9](\-|\/)[0-9][0-9][0-9][0-9]$/", $datum)) {
if (preg_match("/^[0-9][0-9][0-9][0-9](\-|\/)[0-9][0-9][0-9][0-9]$/", $datum)
|| preg_match("/^[0-9][0-9][0-9][0-9](\-|\/)[0-9][0-9][0-9][0-9]\.$/", $datum)
) {
$start = substr($datum, 0, 4);
$end = substr($datum, -4);
$end = substr($datum, 5, 4);
return [$start, $end, "00", "00", "+", ""];
}
if (preg_match("/^[0-9][0-9]\.[0-9]\.[0-9][0-9][0-9][0-9]$/", $datum)) { // German T.MM.JJJJ