EvanHahn / HumanizeDuration.js

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

Polish language support and some configuration possibilities #10

Closed mjjaniec closed 10 years ago

mjjaniec commented 10 years ago

Hi. I'm glad to use your library and hope you would like my contribution. I did extend the library by providing my native language support. First commit is responsible for that. You may also like my new features I added later (it's mentioned in README.md):

Sometimes may get quite long results

humanizeDuration(465472457557)            // "14 years, 8 months, 4 weeks, 2 days, 9 hours, 54 minutes, 17 seconds, 557 milliseconds"

humanizeDuration.maxUnits = 3             // set default max length in units
humanizeDuration(465472457557)            // "14 years, 8 months, 4 weeks"

You may do not like weeks so you can also

humanizeDuration(9531000000)            // "3 months, 2 weeks, 5 days"
humanizeDuration.useWeeks = false;
humanizeDuration(9531000000)            // "3 months, 19 days"

Have a nice day. Michał Janiec

EvanHahn commented 10 years ago

We're already figuring out a way of customizing the output (see #9), so could you send another PR that's just the Polish language support? We'll have the functionality you added soon.

Thanks so much for this!