Skip to content

Commit

Permalink
Return null for empty IntervalSpec
Browse files Browse the repository at this point in the history
  • Loading branch information
merk authored Mar 12, 2018
1 parent b1454e0 commit 8101b0e
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Date/IntervalFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ public static function formatDateInterval(\DateInterval $interval)
$spec .= $interval->s . 'S';
}
}

if ($spec === 'P') {
return null;
}

return $spec;
}
Expand Down

0 comments on commit 8101b0e

Please sign in to comment.