EvanHahn / HumanizeDuration.js

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

Missing case for Slovenian language #194

Closed DanielSWolf closed 3 years ago

DanielSWolf commented 3 years ago

The code that handles the week unit for the Slovenian language seems to be incomplete: It checks three special cases, but it has no else branch for the default case.

Here's the relevant excerpt:

w(c) {
  if (c % 10 === 1) {
    return 'teden';
  } else if (c % 10 === 2 || (Math.floor(c) !== c && c % 100 <= 4)) {
    return 'tedna';
  } else if (c % 10 === 3 || c % 10 === 4) {
    return 'tedne';
  }
},

Google Translate translates "100 weeks" as "100 tednov", so the value for the else branch should probably be "tednov", but I don't speak Slovenian myself.

EvanHahn commented 3 years ago

Thanks for reporting! This should be fixed in humanize-duration@3.25.1.