EvanHahn / HumanizeDuration.js

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

Units Value Format #121

Closed agungwiseso closed 7 years ago

agungwiseso commented 7 years ago

Hi, I have a code like this, Why I got 11845D? without Hours, Minutes, and Seconds?


var shortEnglishHumanizer = humanizeDuration.humanizer({
    language: 'shortEn',
    delimiter: ', ',
    spacer: '',
    units: ['d', 'h', 'm', 's'],
    languages: {
        shortEn: {
            d: function(v) { return 'd' },
            h: function(v) { return 'h' },
            m: function(v) { return 'm' },
            s: function(v) { return 's' },
        }
    }
})
value = shortEnglishHumanizer(1023408000000)
EvanHahn commented 7 years ago

I believe 1,023,408,000,000 milliseconds evenly comes out to 11,845 days. Try changing your input to see other values.

EvanHahn commented 7 years ago

@agungwiseso Did that fix your problem?

agungwiseso commented 7 years ago

Hi, Yes, i have fixed it. Thanks for your reply.