From de565620724eb92bac2331486c10adb748328751 Mon Sep 17 00:00:00 2001 From: gcoue Date: Sun, 31 Dec 2023 16:50:38 +0100 Subject: [PATCH] fix: correct the recurrence function to be more precise on Yearly recurrence --- finalynx/simulator/recurrence.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/finalynx/simulator/recurrence.py b/finalynx/simulator/recurrence.py index a0d372c..de72080 100644 --- a/finalynx/simulator/recurrence.py +++ b/finalynx/simulator/recurrence.py @@ -36,7 +36,7 @@ def __init__( months = months if months is not None else 0 years = years if years is not None else 0 - self._delta = timedelta(days, weeks=4 * months + 52 * years) + self._delta = timedelta(days, weeks=4.3452 * months + 52.1429 * years+0.1429) #Ajout de 0.1429 pour rester au même jour sinon Yearly le 30 au lieu du 31/12 def _next_date(self, current_date: date) -> date: return current_date + self._delta