Try / catch invalid dates in NodaTimeSplitter
This commit is contained in:
parent
09a5096588
commit
d28618bb14
@ -249,7 +249,13 @@ final class NodaTimeSplitter {
|
||||
}
|
||||
else if ($moda[0] === $moda[1] && trim((string)$moda[2], " 0") !== "" && trim((string)$moda[3], " 0") === "") {
|
||||
setlocale(LC_TIME, NodaTimeAutotranslater::LANGS_TO_LOCALES['de']);
|
||||
return $prefix . strftime(getMonthFormatByLang("de"), MD_STD::strtotime("{$moda[0]}-{$moda[2]}-01 01:01:01")) . $suffix;
|
||||
|
||||
try {
|
||||
return $prefix . strftime(getMonthFormatByLang("de"), MD_STD::strtotime("{$moda[0]}-{$moda[2]}-01 01:01:01")) . $suffix;
|
||||
}
|
||||
catch (MDInvalidInputDate $e) {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
return "";
|
||||
|
Loading…
Reference in New Issue
Block a user