Skip to content

Compliments module special days config #3465

@WallysWellies

Description

@WallysWellies

I asked this on the forums and was advised to log a bug.

Platform: RaspberryPi 5 running raspberryPi OS. Current version of MagicMirror software.

When adding config to enable the "special days" feature of the default compliments module it will seemingly add that days comment to the existing array. In my case that array is considerable so special messages such as "Happy Birthday" or "Merry Christmas" etc. are lost in a sea of compliments.

My expectation of this feature would be that on the configured day it shows only the compliments specified in that area of the config. For example:

"....-12-25": ["Happy Christmas!"]

I would expect the only compliment on the 25th December to be "Happy Christmas!". That is not the case though. I am currently adding a line of code in the compliments.js file to empty the array on a special day and only include the configured comments:

// Add compliments for special days
for (let entry in this.config.compliments) {
if (new RegExp(entry).test(date)) {
compliments = []; // Empty the array if it's a special day in config.js
Array.prototype.push.apply(compliments, this.config.compliments[entry]);
}
}

This is not necessarily a "bug" as it may well be the intended behaviour, however I would suggest making this clear in the docs and, if I may be so bold, adding a new config option that allows this behaviour if the user wants it. I am not confident in my coding or GitHub skills to suggest such a change but it seems like it could be quite simple.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions