Skip to content

Commit dbc533e

Browse files
committed
Merge branch '5.4' into 6.0
* 5.4: (27 commits) feat: add completion for DebugAutowiring search argument [Routing] Add support for aliasing routes [DependencyInjection] only allow `ReflectionNamedType` for `ServiceSubscriberTrait` Fix CS [Console] Open CompleteCommand for custom outputs [Intl] Update the ICU data to 70.1 [Messenger] Add completion for failed messages commands. Fix tests Fixing missing full_stack variable that's needed by toolbar.html.twig [PropertyInfo] Bump phpstan/phpdoc-parser [Security] Backport type fixes [VarExporter] escape unicode chars involved in directionality [Framework] Add completion to debug:container [Messenger] Add completion to command messenger:consume [Intl] Update the ICU data to 70.1 Fix more generic types Default access_decision_manager.strategy option with merge. Fix typos Update validators.ca.xlf Add missing Validator translations for Estonian ... Signed-off-by: Alexander M. Turek <me@derrabus.de>
2 parents 1817d62 + ae57e56 commit dbc533e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

Caster/DateCaster.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public static function castDateTime(\DateTimeInterface $d, array $a, Stub $stub,
4949

5050
public static function castInterval(\DateInterval $interval, array $a, Stub $stub, bool $isNested, int $filter)
5151
{
52-
$now = new \DateTimeImmutable();
52+
$now = new \DateTimeImmutable('@0', new \DateTimeZone('UTC'));
5353
$numberOfSeconds = $now->add($interval)->getTimestamp() - $now->getTimestamp();
5454
$title = number_format($numberOfSeconds, 0, '.', ' ').'s';
5555

@@ -63,7 +63,8 @@ private static function formatInterval(\DateInterval $i): string
6363
$format = '%R ';
6464

6565
if (0 === $i->y && 0 === $i->m && ($i->h >= 24 || $i->i >= 60 || $i->s >= 60)) {
66-
$i = date_diff($d = new \DateTime(), date_add(clone $d, $i)); // recalculate carry over points
66+
$d = new \DateTimeImmutable('@0', new \DateTimeZone('UTC'));
67+
$i = $d->diff($d->add($i)); // recalculate carry over points
6768
$format .= 0 < $i->days ? '%ad ' : '';
6869
} else {
6970
$format .= ($i->y ? '%yy ' : '').($i->m ? '%mm ' : '').($i->d ? '%dd ' : '');

0 commit comments

Comments
 (0)