Issue: Calendar setting does not override global setting
See original GitHub issuePlatform: Raspberry Pi 3
Node Version: node v8.2.1
MagicMirror Version: MagicMirror v2.1.3-dev
Description:
In the calendar module documentation it states that the settings maximumEntries
and maximumNumberOfDays
override the global setting (defined in the root of the module config). In practice this only works for the maximumNumberOfDays
setting - the maximumEntries
does not override the global maximumEntries
setting.
Steps to Reproduce:
Define a calendar where you specify the maximumEntries
and maximumNumberOfDays
both on the module level and on the calendar level. When this config is used, the calendar specific maximumNumberOfDays
setting correctly overrides the global maximumNumberOfDays
setting, however the calendar specific maximumEntries
setting does not override the global setting. (see sample config below. The calendar correctly applies the maximum of 56 days, but it only shows 4 maximum entries instead of the expected 6 as the module documentation implies.
Expected Results:
With the config below the calendar should show 6 entries within the 56 day period.
Actual Results:
With the config below the calendar only shows 4 entries within the 56 day period.
Configuration:
{
module: "calendar",
position: "top_left",
header: "<i class=\"fa fa-plane\" aria-hidden=\"true\"></i>Schedule",
config: {
titleReplace: {
NIZ: "Niet inzetbaar",
OSV: "Ouderschaps verlof",
KOV: "Vrij (korte opdracht)",
},
excludedEvents: ["Reisverlof", "EN ROUTE", "AANMELDEN", "AFMELDEN"],
maximumEntries: 4,
maximumNumberOfDays: 4,
calendars: [
{
symbol: "",
fadePoint: 0.3,
maximumEntries: 6,
maximumNumberOfDays: 56,
url: "https://calendar.google.com/calendar/ical/[censored]/basic.ics"
}
]
}
},
Additional Notes:
I’m working on a PR to address this issue - I will also add some test cases in the very near future to prevent regression. However I’m strapped for time at the moment so this will come at a later time
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (8 by maintainers)
@qistoph You’re correct, I’ve started writing some test cases to properly test the calendar configuration and the global ‘maxEntries’ setting is overridden by the calendar specific ‘maxEntries’ setting.
So at the moment the calendar module is working exactly as documented (with regard to the maxEntries config setting).
I agree with you that it makes more sense to have a total maximum for the calendar module and a maximum number of entries per calendar source. But this would require a change to the calendar module source and the documentation of the calendar module configuration. If everyone agrees that this would make more sense than the current implementation I could make a PR for this change?
@qistoph I will write a test case to properly test this - in the meantime, can I see the specific part of your config.js file (the calendar part) to see how you configured your calendar? Take care to remove any private/personal URLS.