Skip to content

Commit 5f8561d

Browse files
committed
Fix version status labels showing date instead of 'End of Life'
1 parent fb13010 commit 5f8561d

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

public/index.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -402,10 +402,11 @@ private function drawUnifiedVersionHeader(array $release): void
402402
[$major, $minor, $patch] = explode('.', $releaseId);
403403
$versionId = $major . '.' . $minor;
404404

405-
$timeLabel = function (string $label, ?DateTime $time): string {
405+
$now = new DateTimeImmutable();
406+
$timeLabel = function (string $label, ?DateTime $time) use ($now): string {
406407
return sprintf('<span><span style="font-weight: 500; margin-right: 0.5em">%s:</span>%s</span>',
407408
$label,
408-
$time ? $time->format('Y-m-d') : 'End of Life',
409+
($time && $time > $now) ? $time->format('Y-m-d') : 'End of Life',
409410
);
410411
};
411412

0 commit comments

Comments
 (0)