diff --git a/src/js/utilJS.js b/src/js/utilJS.js index 8b407ce87a973d40d8e4f76603797390c113bba3..d0b7af867cc7192a43058977a69f901aacc7106b 100644 --- a/src/js/utilJS.js +++ b/src/js/utilJS.js @@ -1113,12 +1113,20 @@ window.time = function(weeks) { if (weeks >= 52) { // at least one year r += `${num(Math.trunc(weeks / 52))} year${Math.trunc(weeks / 52) != 1 ? `s` : ``}`; - if (Math.trunc(weeks - 52) % 4 !== 0) { // more than x years, y months - r += `, `; - } else if (Math.trunc(weeks / 52) > 0) { // more than one year + if ((weeks - 52) % 4 !== 0) { // more than x years, y months + if (Math.trunc(weeks - 52) % 4 > 3) { + r += `, `; + } else { + r += ` and `; + } + } else if (Math.trunc(weeks / 52) > 1) { // more than one year if ((weeks / 52) % 2 !== 0) { // not exactly x years r += ` and `; } + } else if ((weeks - 52) % 4 === 0) { + if (weeks % 52 !== 0) { + r += ` and `; + } } weeks -= Math.trunc(weeks / 52) * 52; // rounds down to and drops number of years }