Improve parsing years in MDPlausiEvent
This commit is contained in:
parent
611afb7944
commit
11c61525e0
|
@ -37,8 +37,8 @@ final class MDPlausiEvent {
|
||||||
|
|
||||||
if (empty($time)) return ['earliest' => false, 'latest' => false];
|
if (empty($time)) return ['earliest' => false, 'latest' => false];
|
||||||
|
|
||||||
// 2005
|
// 20, -1, 233, -233, 2005, -2005
|
||||||
if (in_array(strlen($time), [4, 5], true) and is_numeric(substr($time, 1))) {
|
if (in_array(strlen($time), [2, 3, 4, 5], true) and is_numeric(substr($time, 1))) {
|
||||||
return [
|
return [
|
||||||
'earliest' => strtotime($time . '-01-01'),
|
'earliest' => strtotime($time . '-01-01'),
|
||||||
'latest' => strtotime($time . '-12-31'),
|
'latest' => strtotime($time . '-12-31'),
|
||||||
|
|
Loading…
Reference in New Issue
Block a user