mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
add variable morning afternoon times
This commit is contained in:
@@ -32,7 +32,11 @@ Module.register("compliments", {
|
||||
},
|
||||
updateInterval: 30000,
|
||||
remoteFile: null,
|
||||
fadeSpeed: 4000
|
||||
fadeSpeed: 4000,
|
||||
morningStartTime: 3,
|
||||
morningEndTime: 12,
|
||||
afternoonStartTime: 12,
|
||||
afternoonEndTime: 17
|
||||
},
|
||||
|
||||
// Set currentweather from module
|
||||
@@ -98,9 +102,9 @@ Module.register("compliments", {
|
||||
var hour = moment().hour();
|
||||
var compliments;
|
||||
|
||||
if (hour >= 3 && hour < 12 && this.config.compliments.hasOwnProperty("morning")) {
|
||||
if (hour >= this.config.morningStartTime && hour < this.config.morningEndTime && this.config.compliments.hasOwnProperty("morning")) {
|
||||
compliments = this.config.compliments.morning.slice(0);
|
||||
} else if (hour >= 12 && hour < 17 && this.config.compliments.hasOwnProperty("afternoon")) {
|
||||
} 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);
|
||||
|
Reference in New Issue
Block a user