humanized-duration
Display durations in short yet human readable way.
How to install
npm
npm install humanized-duration
bower
bower install humanized-duration
How to use
NodeJS
var humanized_duration = require('humanized-duration');
Browser
var humanized_duration = window.humanized_duration;
Examples
humanized_duration(59 * 1000)
humanized_duration(60 * 1000)
humanized_duration((58 * 60 + 59) * 1000)
humanized_duration((58 * 60 + 60) * 1000)
humanized_duration((59 * 60 + 59) * 1000)
humanized_duration((59 * 60 + 60) * 1000)
humanized_duration((6 * 24 * 60 * 60 + 23 * 60 * 60 + 59 * 60 + 59) * 1000)
humanized_duration((6 * 24 * 60 * 60 + 23 * 60 * 60 + 59 * 60 + 60) * 1000)
humanized_duration((5 * 24 * 60 * 60 + 23 * 60 * 60 + 59 * 60 + 59) * 1000, 3)
humanized_duration((6 * 24 * 60 * 60 + 23 * 60 * 60 + 59 * 60 + 59) * 1000, 4)