mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-27 19:53:36 +00:00
Fix calendar.js missing default symbol prefix (#3007)
Symbols provided in customEvents don't get the "fas fa-fw fa-" prefix, which according to the docs they should. This fixes that. Hello and thank you for wanting to contribute to the MagicMirror² project **Please make sure that you have followed these 4 rules before submitting your Pull Request:** > 1. Base your pull requests against the `develop` branch. > > 2. Include these infos in the description: > > - Does the pull request solve a **related** issue? > - If so, can you reference the issue like this `Fixes #<issue_number>`? > - What does the pull request accomplish? Use a list if needed. > - If it includes major visual changes please add screenshots. > > 3. Please run `npm run lint:prettier` before submitting so that > style issues are fixed. > > 4. Don't forget to add an entry about your changes to > the CHANGELOG.md file. **Note**: Sometimes the development moves very fast. It is highly recommended that you update your branch of `develop` before creating a pull request to send us your changes. This makes everyone's lives easier (including yours) and helps us out on the development team. Thanks again and have a nice day! Co-authored-by: veeck <michael@veeck.de>
This commit is contained in:
parent
c714399b4d
commit
4244c05764
@ -29,6 +29,7 @@ _This release is scheduled to be released on 2023-04-01._
|
|||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
- Fix wrong day labels in envcanada forecast (#2987)
|
- Fix wrong day labels in envcanada forecast (#2987)
|
||||||
|
- Fix for missing default class name prefix for customEvents in calendar
|
||||||
- Fix weathergov provider hourly forecast (#3008)
|
- Fix weathergov provider hourly forecast (#3008)
|
||||||
|
|
||||||
## [2.22.0] - 2023-01-01
|
## [2.22.0] - 2023-01-01
|
||||||
|
@ -665,7 +665,9 @@ Module.register("calendar", {
|
|||||||
if (typeof ev.symbol !== "undefined" && ev.symbol !== "") {
|
if (typeof ev.symbol !== "undefined" && ev.symbol !== "") {
|
||||||
let needle = new RegExp(ev.keyword, "gi");
|
let needle = new RegExp(ev.keyword, "gi");
|
||||||
if (needle.test(event.title)) {
|
if (needle.test(event.title)) {
|
||||||
symbols[0] = ev.symbol;
|
// Get the default prefix for this class name and add to the custom symbol provided
|
||||||
|
const className = this.getCalendarProperty(event.url, "symbolClassName", this.config.defaultSymbolClassName);
|
||||||
|
symbols[0] = className + ev.symbol;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,9 +11,10 @@ let config = {
|
|||||||
module: "calendar",
|
module: "calendar",
|
||||||
position: "bottom_bar",
|
position: "bottom_bar",
|
||||||
config: {
|
config: {
|
||||||
|
customEvents: [{ keyword: "CustomEvent", symbol: "dice" }],
|
||||||
calendars: [
|
calendars: [
|
||||||
{
|
{
|
||||||
maximumEntries: 4,
|
maximumEntries: 5,
|
||||||
maximumNumberOfDays: 10000,
|
maximumNumberOfDays: 10000,
|
||||||
symbol: "birthday-cake",
|
symbol: "birthday-cake",
|
||||||
fullDaySymbol: "calendar-day",
|
fullDaySymbol: "calendar-day",
|
||||||
|
@ -48,14 +48,18 @@ describe("Calendar module", () => {
|
|||||||
await helpers.getDocument();
|
await helpers.getDocument();
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show the custom maximumEntries of 4", async () => {
|
it("should show the custom maximumEntries of 5", async () => {
|
||||||
await testElementLength(".calendar .event", 4);
|
await testElementLength(".calendar .event", 5);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should show the custom calendar symbol in each event", async () => {
|
it("should show the custom calendar symbol in four events", async () => {
|
||||||
await testElementLength(".calendar .event .fa-birthday-cake", 4);
|
await testElementLength(".calendar .event .fa-birthday-cake", 4);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should show a customEvent calendar symbol in one event", async () => {
|
||||||
|
await testElementLength(".calendar .event .fa-dice", 1);
|
||||||
|
});
|
||||||
|
|
||||||
it("should show two custom icons for repeating events", async () => {
|
it("should show two custom icons for repeating events", async () => {
|
||||||
await testElementLength(".calendar .event .fa-undo", 2);
|
await testElementLength(".calendar .event .fa-undo", 2);
|
||||||
});
|
});
|
||||||
|
@ -53,4 +53,11 @@ RRULE:FREQ=YEARLY;BYMONTH=10;BYMONTHDAY=1
|
|||||||
DTEND;VALUE=DATE:20301002
|
DTEND;VALUE=DATE:20301002
|
||||||
SUMMARY:TestEventRepeatDay
|
SUMMARY:TestEventRepeatDay
|
||||||
END:VEVENT
|
END:VEVENT
|
||||||
|
BEGIN:VEVENT
|
||||||
|
DTSTAMP:20200721T094531Z
|
||||||
|
UID:20200719T094531Z-167389794@marudot.com
|
||||||
|
DTSTART;TZID=Europe/Berlin:20301112T120000
|
||||||
|
DTEND;TZID=Europe/Berlin:20301112T130000
|
||||||
|
SUMMARY:TestEventCustomEventIcon
|
||||||
|
END:VEVENT
|
||||||
END:VCALENDAR
|
END:VCALENDAR
|
Loading…
x
Reference in New Issue
Block a user