EvanHahn / HumanizeDuration.js

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

idea: use browser Intl to avoid embedding strings #209

Closed kapouer closed 1 year ago

kapouer commented 1 year ago

Hi,

The Intl api is quite well supported, and has polyfills (even from polyfill.io).

EvanHahn commented 1 year ago

I like this idea but don't plan to make any significant changes to this library.

Would you like to fork it and make this change? I can link to it from the README if so!

kapouer commented 1 year ago

Actually I already made something in that direction, though not exactly the same since it outputs relative dates (ago, in, etc..) https://github.com/kapouer/duration-relativetimeformat

EvanHahn commented 1 year ago

Looks interesting!

If you build a version of Humanize Duration that uses Intl, let me know and I'll include a link.

I'm going to close this issue for now.