Prevent ambigious splitting of [0-9]{4}-[0-9]{2}

This commit is contained in:
2025-05-06 22:32:00 +02:00
parent 057cac0f1b
commit 1051e10732
2 changed files with 7 additions and 0 deletions

View File

@ -609,6 +609,12 @@ final class NodaTimeSplitter {
// Assume the end is a month
if (intval($month) < 12) {
// If the year is smaller than the second number, do not split, as either month
// or year may be meant
// Example: 1903-04
if (substr($datum, 2, 2) < 12) {
return false;
}
return new NodaSplitTime($year, $year, $month);
}
else {