Allow splitting 1945-48
This commit is contained in:
		| @@ -590,10 +590,18 @@ final class NodaTimeSplitter { | ||||
|             return NodaSplitTime::genExactDate($year, $month, $day); | ||||
|         } | ||||
|         // Intl': 2020-12 | ||||
|         if (\preg_match("/^[0-9]{4}\-[0-9]{2}$/", $datum)) { // German Y-m | ||||
|         if (\preg_match("/^[0-9]{4}\-[0-9]{2}$/", $datum)) { // German Y-m or 1912-15 | ||||
|             $year = \substr($datum, 0, 4); | ||||
|             $month = \substr($datum, 5, 2); | ||||
|             return new NodaSplitTime($year, $year, $month); | ||||
|  | ||||
|             // Assume the end is a month | ||||
|             if (intval($month) < 12) { | ||||
|                 return new NodaSplitTime($year, $year, $month); | ||||
|             } | ||||
|             else { | ||||
|                 $end = \substr($year, 0, 2) . $month; | ||||
|                 return new NodaSplitTime($year, $end); | ||||
|             } | ||||
|         } | ||||
|  | ||||
|         // German MM.JJJJ | ||||
|   | ||||
		Reference in New Issue
	
	Block a user