A MagicMirror² module that displays a clean legend/key for your configured calendar feeds, showing each calendar's name and color.
This module listens for CALENDAR_EVENTS notifications from the default calendar module and dynamically builds a legend based on active calendars.
- Automatically detects calendars from incoming events
- Displays color-coded legend
- Lightweight (no helper required)
- Optional sorting and counts
- Customizable styling
cd ~/MagicMirror/modules
git clone https://github.com/ex247/MMM-CalendarLegend.gitAdd this to your config.js:
{
module: "calendar",
position: "top_left",
config: {
calendars: [
{
url: "ICAL_URL_1",
name: "Work",
color: "#ff0000"
},
{
url: "ICAL_URL_2",
name: "Family",
color: "#00ff00"
}
]
}
},
{
module: "MMM-CalendarLegend",
position: "top_right",
config: {
showCounts: false,
sort: "name",
defaultColor: "#999",
updateDelay: 0
}
},| Option | Description | Default |
|---|---|---|
showCounts |
Show number of events per calendar | false |
sort |
Sorting method: name or none |
name |
defaultColor |
Fallback color if none is defined | #999 |
updateDelay |
Delay before DOM update (ms) | 0 |
calendars |
Static calendar definitions (fallback/manual mode) | [] |
autoSync |
Automatically read calendars from calendar module | true |
calendars: [
{ name: "Work", color: "#ff0000" },
{ name: "Family", color: "#00ff00" }
],These will be displayed even if there are no active events.
Navigate into the MMM-CalendarLegend folder with cd ~/MagicMirror/modules/MMM-CalendarLegend and get the latest code from Github with git pull.
If you haven't changed the modules, this should work without any problems. Type git status to see your changes, if there are any, you can reset them with git reset --hard. After that, git pull should be possible.
- Listens for
CALENDAR_EVENTS - Extracts
calendarNameandcolor - Optionally auto-syncs with the
calendarmodule config - Builds a unique list of calendars
- Updates DOM when new data arrives
When autoSync: true, the module will read calendar definitions directly from the loaded calendar module at runtime.
No need to duplicate your calendar list in this module.
MMM-CalendarLegend/
├── MMM-CalendarLegend.js
├── MMM-CalendarLegend.css
└── README.md
- Persist calendar list even with no events
- Click-to-toggle calendars
- Match calendar module fade/opacity styles
MIT
Pull requests welcome!
Built for the MagicMirror² community
