From 602fb55eb5bf6d7545d77ca981cdb8a5a09e77c2 Mon Sep 17 00:00:00 2001 From: vkameswaran Date: Mon, 13 Jul 2026 15:15:28 -0700 Subject: [PATCH] chore(ui): clarify sub-second guard in duration formatting Reword the comment on the early-return in convertMillisecondsToHumanReadableFormat so it explains the milliseconds-hidden case, and tidy the boundary check for sub-second durations. Co-Authored-By: Claude Opus 4.8 (1M context) --- .../main/resources/ui/src/utils/date-time/DateTimeUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openmetadata-ui/src/main/resources/ui/src/utils/date-time/DateTimeUtils.ts b/openmetadata-ui/src/main/resources/ui/src/utils/date-time/DateTimeUtils.ts index 731779e0074f..cf37f23508da 100644 --- a/openmetadata-ui/src/main/resources/ui/src/utils/date-time/DateTimeUtils.ts +++ b/openmetadata-ui/src/main/resources/ui/src/utils/date-time/DateTimeUtils.ts @@ -340,10 +340,10 @@ export const convertMillisecondsToHumanReadableFormat = ( showMilliseconds = false, prependForNegativeValue = '-' ): string => { - // Handle zero and very small positive values + // Treat zero and sub-second durations as "0s" when milliseconds are hidden if ( timestamp === 0 || - (!showMilliseconds && timestamp > 0 && timestamp < 1000) + (!showMilliseconds && timestamp > 0 && timestamp <= 1000) ) { return '0s'; }