fix: Issue #1798 - fixing recurrent calendar events crosstime DST

This commit is contained in:
Kurtis Blankenship
2020-01-17 22:53:14 -06:00
parent 5bf90ae31d
commit 8aa745471b
10 changed files with 235 additions and 228 deletions

View File

@@ -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();