We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0cc55f9 commit 18663f4Copy full SHA for 18663f4
library/Notifications/Widget/TimeGrid/Util.php
@@ -5,6 +5,7 @@
5
namespace Icinga\Module\Notifications\Widget\TimeGrid;
6
7
use DateTime;
8
+use InvalidArgumentException;
9
10
final class Util
11
{
@@ -14,6 +15,9 @@ final class Util
14
15
public static function diffHours(DateTime $from, DateTime $to)
16
17
$diff = $from->diff($to);
18
+ if ($diff->invert) {
19
+ throw new InvalidArgumentException('The end date must be after the start date');
20
+ }
21
22
$hours = 0;
23
if ($diff->h > 0) {
0 commit comments