Read the statement by Michael Teeuw here.
Default Compliments Module - Special Days
-
I wasn’t sure where to put this but I wanted to make use of the “special days” feature of the default compliments and it didn’t behave as I was expecting. I assumed it would override the normally configured compliments and show only the one(s) specific to that day, however it appears to just add the day’s compliments to the existing list.
For example I have this in my config:
"....-12-25": ["Happy Christmas WallysWellies!"]
But that message just gets added to my many already configured compliments (I changed the date to test).
For anyone like me that wants to show only this message on your chosen day I tweaked the compliments.js file around line 98 from this:
// Add compliments for special days for (let entry in this.config.compliments) { if (new RegExp(entry).test(date)) { Array.prototype.push.apply(compliments, this.config.compliments[entry]); } }
to this:
// 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]); } }
It just empties the compliments array if it’s a date specified in the config file (or at least I assume that’s how it works - seemed happy in a quick test!).
I didn’t see much info when searching for answers so I thought I might throw it out there for info / discussion.
-
@WallysWellies you should submit that as a bug to the github repo
-
@sdetweil I can do that. I wasn’t sure if it was considered a bug but I’ll log it and see what they say.
-
@WallysWellies said in Default Compliments Module - Special Days:
see what they say.
i help decide too