Windmill Markets limit count fix

This commit is contained in:
Edward Betts 2023-11-05 14:49:06 +00:00
parent ac802ab944
commit cfdb06083b

View file

@ -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)