fix bug when date interval for 1 day or multiple years

This commit is contained in:
Julien Fastré 2018-06-05 09:42:31 +02:00
parent d3d8f27c6d
commit f6f1b504bd

View File

@ -74,13 +74,15 @@ class NativeDateIntervalType extends DateIntervalType
if (is_numeric($current)) {
$next = \next($strings);
switch($next) {
case 'year':
case 'year':
case 'years':
$unit = 'Y';
break;
case 'mon':
case 'mons':
$unit = 'M';
break;
case 'day':
case 'days':
$unit = 'D';
break;