A New Chapter for MagicMirror: The Community Takes the Lead
Read the statement by Michael Teeuw here.
Read the statement by Michael Teeuw here.
Unable to put a compliment weekly.
-
I want to put a compliment every friday, but i did not find any information on the documentation neither google.
It is possible to do this?? -
Hi @elwonner
It’s doable with minor code change. Below is the code you need to achieve the same.- Compliments declaration
compliments: { anytime: ["Hey there sexy!"], morning: ["Good morning, handsome!", "Enjoy your day!", "How was your sleep?"], afternoon: ["Hello, beauty!", "You look sexy!", "Looking good today!"], evening: ["Wow, you look hot!", "You look nice!", "Hi, sexy!"], "....-01-01": ["Happy new year!"], "Monday": ["Hello Monday !"], "Friday": ["Thank God, It's Friday !"] },
- ComplimentsArray function
complimentArray: function () { var hour = moment().hour(); var date = this.config.mockDate ? this.config.mockDate : moment().format("YYYY-MM-DD"); var day = this.config.mockDay ? this.config.mockDay : moment().format('dddd'); //Add this line var compliments; ------ removed some code for brevity, do not actually remove it ! for (var entry in this.config.compliments) { if (new RegExp(entry).test(date) || new RegExp(entry).test(day)) { //Change this line, Note the second check for day compliments.push.apply(compliments, this.config.compliments[entry]); } }
Output should be as below
–
Ashish