from datetime import datetime, date, timezone import locale import sys from calendarstuff import get_events def fetch_upcoming_events(ics_url): events = get_events(ics_url) for event in events: start = event.get('dtstart').dt out_summary = event.get('summary') location = event.get('location', 'No location specified') out_startdate = start.strftime("%a. %-d. %B %Y") # Format output based on whether it's an all-day event if isinstance(start, date) and not isinstance(start, datetime): out_starttime = " " else: out_starttime = start.strftime('%-H:%M') if location != 'No location specified': out_location = location else: out_location = " " print(f"*