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 authored and EvanHahn committed May 25, 2024
1 parent c8cbeb6 commit e0a885c
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 e0a885c

Please sign in to comment.