EvanHahn / HumanizeDuration.js

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

Accept other value instead milliseconds #81

Closed NetanelBasal closed 9 years ago

NetanelBasal commented 9 years ago

I need to humanize number, but I get the number in minutes, and I required to do this:

var input = 6000;
humanizeDuration(input * 60000, { round: true });

There is an option to do this native with the plugin?

EvanHahn commented 9 years ago

The library doesn't handle this. I don't intend to add this functionality; JavaScript deals with everything in milliseconds.

brandly commented 9 years ago

@NetanelBasal you could use the milliseconds module to say

humanizeDuration(ms.minutes(input), { round: true });