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 2ca28f5 commit 88c5c42Copy full SHA for 88c5c42
1 file changed
include/branches.inc
@@ -26,8 +26,11 @@ function get_old_releases(): array
26
return $cache ??= require __DIR__ . '/releases.inc';
27
}
28
29
-function format_interval($from, DateTime $to) {
+function format_interval($from, DateTime|DateTimeImmutable $to) {
30
try {
31
+ $from = ($from instanceof DateTimeImmutable) ? DateTime::createFromImmutable($from): $from;
32
+ $to = ($to instanceof DateTimeImmutable) ? DateTime::createFromImmutable($to) : $to;
33
+
34
$from_obj = $from instanceof DateTime ? $from : new DateTime($from);
35
$diff = $to->diff($from_obj);
36
0 commit comments