FORMAT: sort if/then/else statememt for better readability
This commit is contained in:
parent
a23a97c13d
commit
c09e62aab8
1 changed files with 5 additions and 5 deletions
|
@ -116,14 +116,14 @@ Module.register("MMM-covid19", {
|
||||||
// 0: normal (arrow right)
|
// 0: normal (arrow right)
|
||||||
// -0: green (arrow down)
|
// -0: green (arrow down)
|
||||||
currentToLastWeekDiff = (data[this.config.region]["last_7"] * 2) - data[this.config.region]["last_14"]
|
currentToLastWeekDiff = (data[this.config.region]["last_7"] * 2) - data[this.config.region]["last_14"]
|
||||||
if (currentToLastWeekDiff < 0) {
|
if (currentToLastWeekDiff > 10) {
|
||||||
this.cases.trend = "<span class=good>↘</span>";
|
|
||||||
} else if (currentToLastWeekDiff == 0) {
|
|
||||||
this.cases.trend = "&#rarr;";
|
|
||||||
} else if (currentToLastWeekDiff > 10) {
|
|
||||||
this.cases.trend = "<span class=bad>↗</span>";
|
this.cases.trend = "<span class=bad>↗</span>";
|
||||||
} else if (currentToLastWeekDiff > 0) {
|
} else if (currentToLastWeekDiff > 0) {
|
||||||
this.cases.trend = "<span class=warn>↗</span>";
|
this.cases.trend = "<span class=warn>↗</span>";
|
||||||
|
} else if (currentToLastWeekDiff == 0) {
|
||||||
|
this.cases.trend = "&#rarr;";
|
||||||
|
} else if (currentToLastWeekDiff < 0) {
|
||||||
|
this.cases.trend = "<span class=good>↘</span>";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue