jinks_widgets.calendar¶
This file contains the calendar widget class.
Functions
|
Get calendar data from the specified URL. |
Classes
|
Data class for calendar widget data. |
|
Data class representing a calendar event. |
Class defining the calendar widget which shows upcoming events from an Apple calendar. |
- class jinks_widgets.calendar.CalendarEvent(title, start_date, end_date, is_all_day)¶
Bases:
objectData class representing a calendar event.
- title: str¶
- start_date: datetime¶
- end_date: datetime¶
- is_all_day: bool¶
- format_display_text(max_title_length=20)¶
Format the event for display with appropriate date formatting.
- Return type:
str
- __init__(title, start_date, end_date, is_all_day)¶
- class jinks_widgets.calendar.CalendarData(events, last_updated)¶
Bases:
objectData class for calendar widget data.
- events: List[CalendarEvent]¶
- last_updated: datetime¶
- classmethod from_ical_url(calendar_url, days_ahead=14)¶
Fetch and parse calendar data from an iCal URL.
- Return type:
- __init__(events, last_updated)¶
- jinks_widgets.calendar.get_calendar_data(calendar_url, days_ahead=14)¶
Get calendar data from the specified URL.
- Return type:
- class jinks_widgets.calendar.CalendarUpcoming¶
Bases:
objectClass defining the calendar widget which shows upcoming events from an Apple calendar.
It fetches data from an iCal URL and displays the next few events with appropriate date and time formatting.
- width: int = 12¶
- height: int = 6¶
- color = 'BWG'¶
- font_sizes = {40: 12}¶
- classmethod data(calendar_url, days_ahead=14)¶
Get the upcoming calendar events.
- Return type:
- classmethod display(density, widget_data)¶
Render the calendar widget image showing upcoming events.
- Return type:
Image