From 4032c9543e5e2f2e347a2ceac64e9acaf03be15f Mon Sep 17 00:00:00 2001 From: DeanStr Date: Tue, 5 Nov 2024 22:22:43 +1100 Subject: [PATCH] Fix getYearMonthText incorrect months Months was essentially calculated off a 48 week year, or each month being exactly 4 weeks, which isn't correct --- airline-web/public/javascripts/gadgets.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/airline-web/public/javascripts/gadgets.js b/airline-web/public/javascripts/gadgets.js index 4105e6122..10c5aceab 100644 --- a/airline-web/public/javascripts/gadgets.js +++ b/airline-web/public/javascripts/gadgets.js @@ -369,7 +369,7 @@ function getDurationText(duration) { function getYearMonthText(weekDuration) { var year = Math.floor(weekDuration / 52) - var month = Math.floor(weekDuration / 4) % 12 + var month = Math.floor(weekDuration / (52/12)) % 12 if (year > 0) { return year + " year(s) " + month + " month(s)" } else {