Skip to content

Commit 786ea86

Browse files
authored
Cleanup calendar module (#3300)
- Update default calendar config to use customEvents - Update url that is displayed when old authentication is used
1 parent d397568 commit 786ea86

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ _This release is scheduled to be released on 2024-01-01._
1919
### Removed
2020

2121
- Removed Codecov workflow (not working anymore, other workflow required) (#3107)
22-
- Removed titleReplace from calendar, replaced + extended by customEvents (backward compatibility included)
22+
- Removed titleReplace from calendar, replaced + extended by customEvents (backward compatibility included) (#3249)
2323
- Removed failing unit test (#3254)
2424

2525
### Updated

modules/default/calendar/calendar.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,32 +28,32 @@ Module.register("calendar", {
2828
fetchInterval: 60 * 60 * 1000, // Update every hour
2929
animationSpeed: 2000,
3030
fade: true,
31+
fadePoint: 0.25, // Start on 1/4th of the list.
3132
urgency: 7,
3233
timeFormat: "relative",
3334
dateFormat: "MMM Do",
3435
dateEndFormat: "LT",
3536
fullDayEventDateFormat: "MMM Do",
3637
showEnd: false,
3738
getRelative: 6,
38-
fadePoint: 0.25, // Start on 1/4th of the list.
3939
hidePrivate: false,
4040
hideOngoing: false,
4141
hideTime: false,
4242
hideDuplicates: true,
4343
showTimeToday: false,
4444
colored: false,
45-
customEvents: [], // Array of {keyword: "", symbol: "", color: "", eventClass: ""} where Keyword is a regexp and symbol/color/eventClass are to be applied for matched
4645
tableClass: "small",
4746
calendars: [
4847
{
4948
symbol: "calendar-alt",
5049
url: "https://www.calendarlabs.com/templates/ical/US-Holidays.ics"
5150
}
5251
],
53-
titleReplace: {
54-
"De verjaardag van ": "",
55-
"'s birthday": ""
56-
},
52+
customEvents: [
53+
// Array of {keyword: "", symbol: "", color: "", eventClass: ""} where Keyword is a regexp and symbol/color/eventClass are to be applied for matched
54+
{ keyword: ".*", transform: { search: "De verjaardag van ", replace: "" } },
55+
{ keyword: ".*", transform: { search: "'s birthday", replace: "" } }
56+
],
5757
locationTitleReplace: {
5858
"street ": ""
5959
},
@@ -145,7 +145,7 @@ Module.register("calendar", {
145145
// we check user and password here for backwards compatibility with old configs
146146
if (calendar.user && calendar.pass) {
147147
Log.warn("Deprecation warning: Please update your calendar authentication configuration.");
148-
Log.warn("https://github.com/MichMich/MagicMirror/tree/v2.1.2/modules/default/calendar#calendar-authentication-options");
148+
Log.warn("https://docs.magicmirror.builders/modules/calendar.html#configuration-options");
149149
calendar.auth = {
150150
user: calendar.user,
151151
pass: calendar.pass

0 commit comments

Comments
 (0)