From eb8d23b008db6927d69b148e4c0178d785ae4ae2 Mon Sep 17 00:00:00 2001 From: Mohammed Date: Thu, 23 May 2024 20:11:43 +0300 Subject: [PATCH] hide the spacer if the count is hidden --- humanize-duration.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/humanize-duration.js b/humanize-duration.js index 771fef0..2895f17 100644 --- a/humanize-duration.js +++ b/humanize-duration.js @@ -1698,6 +1698,10 @@ word = languageWord; } + // Never add a spacer if the count is hidden + if (language._hideCountIf2 && unitCount == 2) { + spacer = ""; + } if (language._numberFirst) { return word + spacer + formattedCount; }