FORMAT: sort if/then/else statememt for better readability

This commit is contained in:
Sebastian Mark 2020-07-26 16:24:02 +02:00
parent a23a97c13d
commit c09e62aab8

View file

@ -116,14 +116,14 @@ Module.register("MMM-covid19", {
// 0: normal (arrow right)
// -0: green (arrow down)
currentToLastWeekDiff = (data[this.config.region]["last_7"] * 2) - data[this.config.region]["last_14"]
if (currentToLastWeekDiff < 0) {
this.cases.trend = "<span class=good>&searr;</span>";
} else if (currentToLastWeekDiff == 0) {
this.cases.trend = "&#rarr;";
} else if (currentToLastWeekDiff > 10) {
if (currentToLastWeekDiff > 10) {
this.cases.trend = "<span class=bad>&nearr;</span>";
} else if (currentToLastWeekDiff > 0) {
this.cases.trend = "<span class=warn>&nearr;</span>";
} else if (currentToLastWeekDiff == 0) {
this.cases.trend = "&#rarr;";
} else if (currentToLastWeekDiff < 0) {
this.cases.trend = "<span class=good>&searr;</span>";
}
},
});