From 03bab92cb8c02743428b118f11ad909504aba2c2 Mon Sep 17 00:00:00 2001 From: Sarjuuk Date: Sat, 15 Nov 2025 20:00:50 +0100 Subject: [PATCH] DateTime/Fixup * fix displaying expected '0 seconds' instead of 'n/a' or '1 ms' --- localization/datetime.class.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/localization/datetime.class.php b/localization/datetime.class.php index f6789390..8e4685d4 100644 --- a/localization/datetime.class.php +++ b/localization/datetime.class.php @@ -140,7 +140,7 @@ class DateTime extends \DateTimeImmutable */ public static function formatTimeElapsedFloat(int $delay) : string { - $delay = max($delay, 1); + $delay = abs($delay); for ($i = 0; $i < count(self::RANGE); ++$i) { @@ -151,7 +151,7 @@ class DateTime extends \DateTimeImmutable return $v . self::NBSP . Lang::timeUnits($v === 1.0 ? 'sg' : 'pl', $i); } - return Lang::main('n_a'); + return '0' . self::NBSP . Lang::timeUnits('pl', 6); // 0 seconds } /**