From cfdb06083bac52c0798acf87e8a9cd9c58ba0415 Mon Sep 17 00:00:00 2001 From: Edward Betts Date: Sun, 5 Nov 2023 14:49:06 +0000 Subject: [PATCH] Windmill Markets limit count fix --- agenda/markets.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/agenda/markets.py b/agenda/markets.py index 1aad547..d6901d4 100644 --- a/agenda/markets.py +++ b/agenda/markets.py @@ -100,6 +100,7 @@ def nailsea_farmers(start_date: date, months: int = 24) -> list[Event]: while count < months: # Calculate the 3rd Saturday of the current month third_saturday = current_date + relativedelta(day=1, weekday=SA(+3)) + count += 1 # Include it in the list only if it's on or after the start_date if third_saturday >= start_date: @@ -110,7 +111,6 @@ def nailsea_farmers(start_date: date, months: int = 24) -> list[Event]: date=uk_tz.localize(datetime.combine(third_saturday, t)), ) ) - count += 1 # Move to the next month current_date += relativedelta(months=1)