This project provides a Glance widget that fetches and parses calendar data (iCal/VEVENT format) from a given URL.
- Accepts a URL as a query parameter
- Fetches and parses VEVENT entries from the calendar
- Returns only events with a date greater than or equal to today
- Dates are formatted as "Month Day, Year" (e.g., May 25, 2025)
- Times are formatted as "HH:MM AM/PM" (e.g., 10:00 AM)
- Dockerfile included for easy containerization
- Install dependencies:
pip install fastapi uvicorn httpx
- Start the server:
uvicorn main:app --host 0.0.0.0 --port 8009
- Access the API:
GET http://localhost:8009/?url=<YOUR_WEBDAV_URL>
- Build the Docker image:
docker build -t glance-calendar . - Run the container:
docker run -p 8009:8009 glance-calendar
GET /?url=<webdav_url>: Returns a JSON array of upcoming events with their summary, date, and time information.
{
"events": [
{"summary": "Rob Dentist", "date": "May 25, 2025", "startTime": "10:00 AM", "endTime": "11:00 AM"},
{"summary": "Team Meeting", "date": "June 1, 2025", "startTime": "09:30 AM", "endTime": "10:30 AM"}
]
}- type: custom-api
title: "Events"
cache: 1h
url: "http://glance-icalendar:8009/calendar?url=YOUR-URL-HERE"
template: |
<ul class="list list-gap-10 collapsible-container" data-collapse-after="5">
{{ range .JSON.Array "events" }}
<li>
<p class="size-h4 color-highlight block text-truncate">{{ .String "summary" }}</p>
<ul class="list-horizontal-text">
{{ .String "date" }}
</ul>
<ul class="list-horizontal-text">
{{ if .Exists "startTime" }}
<li>{{ .String "startTime" }}{{ if .Exists "endTime" }} - {{ .String "endTime" }}{{ end }}</li>
{{ else }}
<li>All Day</li>
{{ end }}
</ul>
</li>
{{ end }}
</ul>
MIT