From 7deedad351bf16117d1c239abe4480a872075ff5 Mon Sep 17 00:00:00 2001 From: moanos Date: Thu, 8 Aug 2024 17:17:00 +0200 Subject: [PATCH] fix: month calculation --- src/fellchensammlung/tools/misc.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/fellchensammlung/tools/misc.py b/src/fellchensammlung/tools/misc.py index 72331eb..c3ab94b 100644 --- a/src/fellchensammlung/tools/misc.py +++ b/src/fellchensammlung/tools/misc.py @@ -15,6 +15,7 @@ def age_as_hr_string(age: datetime.timedelta) -> str: months = age.days/30 years = age.days/365 if years >= 1: + months = months - 12*years return f'{years:.0f} Jahr{pluralize(years)} und {months:.0f} Monat{pluralize(months)}' elif months >= 3: return f'{months:.0f} Monat{pluralize(months)}'