MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. ItsMeCobra2006
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 1
    • Groups 0

    ItsMeCobra2006

    @ItsMeCobra2006

    1
    Reputation
    333
    Profile views
    1
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    ItsMeCobra2006 Unfollow Follow

    Best posts made by ItsMeCobra2006

    • RE: Is there a way to show specific compliments on specific dates?

      In case someone is still wondering how to simply display set compliments on set days: ```

      complimentArray: function() {
      		var hour = moment().hour();
      		var date = moment().format('DDMM');  \\add this into compliments.js
      		var compliments;
      
      		if (hour >= this.config.morningStartTime && hour < this.config.morningEndTime && this.config.compliments.hasOwnProperty("morning")) {
      			compliments = this.config.compliments.morning.slice(0);
      		} else if (hour >= this.config.afternoonStartTime && hour < this.config.afternoonEndTime && this.config.compliments.hasOwnProperty("afternoon")) {
      			compliments = this.config.compliments.afternoon.slice(0);
      		} else if(this.config.compliments.hasOwnProperty("evening")) {
      			compliments = this.config.compliments.evening.slice(0);
      		}
      
      		if (typeof compliments === "undefined") {
      			compliments = new Array();
      		}
      		
      
      		if (this.currentWeatherType in this.config.compliments) {
      			compliments.push.apply(compliments, this.config.compliments[this.currentWeatherType]);
      		}
      
        	    if (date in this.config.compliments) {
      			compliments.push.apply(compliments, this.config.compliments[date]);
      		} \\add these 3 lines into compliments.js
      
      		compliments.push.apply(compliments, this.config.compliments.anytime);
      
      		return compliments;
      	}, 
      

      Example:

      anytime: [
      				"Hey there sexy!"
      			],
      			morning: [
      				"Good morning, handsome!",
      				"Enjoy your day!",
      				"How was your sleep?"
      			],
      			afternoon: [
      				"Hello, beauty!",
      				"You look sexy!",
      				"Looking good today!"
      			],
      			"1005": [
      				"Today is May 10th",
      				"You look nice!",
      				"Hi, sexy!"
      			] 
      		},
      

      EDIT:
      Anyone know how to show compliments on days without a set date each year, like Christmas, but something like the second Sunday of May, like Mother’s day?

      posted in Troubleshooting
      ItsMeCobra2006I
      ItsMeCobra2006

    Latest posts made by ItsMeCobra2006

    • RE: Is there a way to show specific compliments on specific dates?

      In case someone is still wondering how to simply display set compliments on set days: ```

      complimentArray: function() {
      		var hour = moment().hour();
      		var date = moment().format('DDMM');  \\add this into compliments.js
      		var compliments;
      
      		if (hour >= this.config.morningStartTime && hour < this.config.morningEndTime && this.config.compliments.hasOwnProperty("morning")) {
      			compliments = this.config.compliments.morning.slice(0);
      		} else if (hour >= this.config.afternoonStartTime && hour < this.config.afternoonEndTime && this.config.compliments.hasOwnProperty("afternoon")) {
      			compliments = this.config.compliments.afternoon.slice(0);
      		} else if(this.config.compliments.hasOwnProperty("evening")) {
      			compliments = this.config.compliments.evening.slice(0);
      		}
      
      		if (typeof compliments === "undefined") {
      			compliments = new Array();
      		}
      		
      
      		if (this.currentWeatherType in this.config.compliments) {
      			compliments.push.apply(compliments, this.config.compliments[this.currentWeatherType]);
      		}
      
        	    if (date in this.config.compliments) {
      			compliments.push.apply(compliments, this.config.compliments[date]);
      		} \\add these 3 lines into compliments.js
      
      		compliments.push.apply(compliments, this.config.compliments.anytime);
      
      		return compliments;
      	}, 
      

      Example:

      anytime: [
      				"Hey there sexy!"
      			],
      			morning: [
      				"Good morning, handsome!",
      				"Enjoy your day!",
      				"How was your sleep?"
      			],
      			afternoon: [
      				"Hello, beauty!",
      				"You look sexy!",
      				"Looking good today!"
      			],
      			"1005": [
      				"Today is May 10th",
      				"You look nice!",
      				"Hi, sexy!"
      			] 
      		},
      

      EDIT:
      Anyone know how to show compliments on days without a set date each year, like Christmas, but something like the second Sunday of May, like Mother’s day?

      posted in Troubleshooting
      ItsMeCobra2006I
      ItsMeCobra2006