Skip to content

Commit cfff58c

Browse files
committed
fix: Handling of date time in FormatUtcDateViewHelper
1 parent 5142dbb commit cfff58c

2 files changed

Lines changed: 3 additions & 5 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@
1313
*GENERATED*
1414
Tests/Unit/Build/.phpunit.cache/
1515
Tests/Functional/Build/.phpunit.cache/
16-
16+
/packages

Classes/ViewHelpers/DateTime/FormatUtcDateViewHelper.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ public function render(): string
2828

2929
$date = $this->arguments['date'];
3030
if ($date instanceof \DateTimeInterface) {
31-
$renderChildrenClosure = static function () use ($date) {
32-
// Convert date to timestamp, so that it can be reparsed.
33-
return $date->getTimestamp();
34-
};
31+
// Convert date to timestamp, so that the parent reparses it in the UTC timezone.
32+
$this->arguments['date'] = $date->getTimestamp();
3533
}
3634

3735
$result = parent::render();

0 commit comments

Comments
 (0)