From 0c8a72d9ef40088ca7d93f6c7445bb84f98d8275 Mon Sep 17 00:00:00 2001 From: DCoded <dsoloha@live.com> Date: Tue, 28 May 2019 00:58:00 -0400 Subject: [PATCH] Time() polishes --- src/js/utilJS.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/js/utilJS.js b/src/js/utilJS.js index d0b7af867cc..660fe7d0d66 100644 --- a/src/js/utilJS.js +++ b/src/js/utilJS.js @@ -1113,18 +1113,10 @@ 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 ((weeks - 52) % 4 !== 0) { // more than x years, y months - if (Math.trunc(weeks - 52) % 4 > 3) { + if ((weeks - 52) % 4 !== 0) { // not exactly x years, y months 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) { + } else { + if (weeks % 52 !== 0) { // not exactly x years r += ` and `; } } -- GitLab