mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-08-21 12:55:22 +00:00
fix: Issue #1798 - fixing recurrent calendar events crosstime DST
This commit is contained in:
@@ -39,7 +39,7 @@ Module.register("compliments", {
|
||||
afternoonEndTime: 17,
|
||||
random: true
|
||||
},
|
||||
lastIndexUsed:-1,
|
||||
lastIndexUsed:-1,
|
||||
// Set currentweather from module
|
||||
currentWeatherType: "",
|
||||
|
||||
@@ -151,7 +151,7 @@ Module.register("compliments", {
|
||||
// get the current time of day compliments list
|
||||
var compliments = this.complimentArray();
|
||||
// variable for index to next message to display
|
||||
let index=0
|
||||
let index=0;
|
||||
// are we randomizing
|
||||
if(this.config.random){
|
||||
// yes
|
||||
@@ -160,28 +160,28 @@ Module.register("compliments", {
|
||||
else{
|
||||
// no, sequetial
|
||||
// if doing sequential, don't fall off the end
|
||||
index = (this.lastIndexUsed >= (compliments.length-1))?0: ++this.lastIndexUsed
|
||||
index = (this.lastIndexUsed >= (compliments.length-1))?0: ++this.lastIndexUsed;
|
||||
}
|
||||
|
||||
return compliments[index];
|
||||
},
|
||||
|
||||
// Override dom generator.
|
||||
// Override dom generator.
|
||||
getDom: function() {
|
||||
var wrapper = document.createElement("div");
|
||||
wrapper.className = this.config.classes ? this.config.classes : "thin xlarge bright pre-line";
|
||||
// get the compliment text
|
||||
// get the compliment text
|
||||
var complimentText = this.randomCompliment();
|
||||
// split it into parts on newline text
|
||||
var parts= complimentText.split('\n')
|
||||
// split it into parts on newline text
|
||||
var parts= complimentText.split("\n");
|
||||
// create a span to hold it all
|
||||
var compliment=document.createElement('span')
|
||||
// process all the parts of the compliment text
|
||||
var compliment=document.createElement("span");
|
||||
// process all the parts of the compliment text
|
||||
for (part of parts){
|
||||
// create a text element for each part
|
||||
compliment.appendChild(document.createTextNode(part))
|
||||
compliment.appendChild(document.createTextNode(part));
|
||||
// add a break `
|
||||
compliment.appendChild(document.createElement('BR'))
|
||||
compliment.appendChild(document.createElement("BR"));
|
||||
}
|
||||
// remove the last break
|
||||
compliment.lastElementChild.remove();
|
||||
|
Reference in New Issue
Block a user