EvanHahn / HumanizeDuration.js

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

Round to next year if previous round was 12 months. #88

Closed lolobosse closed 8 years ago

lolobosse commented 8 years ago

Hi there,

I tested the lib with some random data and I think I find a small bug.

Here is my code:

de_humanizer = humanizeDuration.humanizer({
      language: "de",
      units: ["y", "mo"]
    });
var time = 3692131200000;
var duration = de_humanizer(time, {round: true});

And duration is 116 Jahre, 12 Monate which is a bit incoherent I guess.

Great work though!

Best

EvanHahn commented 8 years ago

Good catch! I'll fix this.

EvanHahn commented 8 years ago

This should be fixed in humanize-duration@3.6.1. Let me know if you run into more issues!