Compare commits

..

No commits in common. "a9cad3c74998a1d488190d4d4ebf48faecd4cc50" and "c6bc2f5f723366918bf4ce604290a7d247fdbdca" have entirely different histories.

View file

@ -313,21 +313,13 @@ def critical_mass(start_date: date, limit: int = 12) -> list[Event]:
events: list[Event] = [] events: list[Event] = []
current_date = start_date current_date = start_date
tz = pytz.timezone("Europe/London")
t = time(18, 0)
for _ in range(limit): for _ in range(limit):
# Calculate the last Friday of the current month # Calculate the last Friday of the current month
last_friday = current_date + relativedelta(day=31, weekday=FR(-1)) last_friday = current_date + relativedelta(day=31, weekday=FR(-1))
# Include it in the list only if it's on or after the start_date # Include it in the list only if it's on or after the start_date
if last_friday >= start_date: if last_friday >= start_date:
events.append( events.append(Event(name="critical_mass", date=last_friday))
Event(
name="critical_mass",
date=tz.localize(datetime.combine(last_friday, t)),
)
)
# Move to the next month # Move to the next month
current_date += relativedelta(months=1) current_date += relativedelta(months=1)
@ -344,7 +336,6 @@ def windmill_hill_market_days(start_date: date) -> list[Event]:
count = 0 count = 0
tz = pytz.timezone("Europe/London") tz = pytz.timezone("Europe/London")
t = time(10, 0)
while count < 12: while count < 12:
# Skip months outside of April to December # Skip months outside of April to December
@ -362,7 +353,7 @@ def windmill_hill_market_days(start_date: date) -> list[Event]:
Event( Event(
name="market", name="market",
title="Windmill Hill Market", title="Windmill Hill Market",
date=tz.localize(datetime.combine(first_saturday, t)), date=tz.localize(datetime.combine(first_saturday, time(10, 0))),
) )
) )
count += 1 count += 1