Skip to content

Commit

Permalink
hide the spacer if the count is hidden
Browse files Browse the repository at this point in the history
  • Loading branch information
6km committed May 23, 2024
1 parent 217ddf2 commit eb8d23b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions humanize-duration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit eb8d23b

Please sign in to comment.