EvanHahn / HumanizeDuration.js

361000 becomes "6 minutes, 1 second"
https://evanhahn.github.io/HumanizeDuration.js/
The Unlicense
1.65k stars 175 forks source link

Provide an option to omit the spacing between values and units #197

Closed cameronbraid closed 3 years ago

cameronbraid commented 3 years ago

When using a shortEnglishHumanizer as per your docs, I would like it to render as follows :

shortEnglishHumanizer(15600000); // '4h, 20m'

instead of

shortEnglishHumanizer(15600000); // '4 h, 20 m'
EvanHahn commented 3 years ago

You should be able to use the spacer option:

humanizeDuration(260040000, { spacer: "" });

Hope this helps!

cameronbraid commented 3 years ago

Thanks mate.. dunno how I missed that when looking at the docs :)

EvanHahn commented 3 years ago

No problem. There are a lot of options!