Change if statement with conditional operator

This commit is contained in:
emelko
2019-05-01 13:07:40 +02:00
parent 3ec4d2218e
commit ea36d4ec7a
+1 -5
View File
@@ -220,9 +220,5 @@ function getBleedingPredictionRange(prediction) {
if (todayDate.isAfter(predictedBleedingEnd)) { if (todayDate.isAfter(predictedBleedingEnd)) {
return labels.unknown return labels.unknown
} }
if (daysToEnd === 0) { return (daysToEnd === 0 ? '0' : `0 - ${daysToEnd}`)
return '0'
} else {
return `0 - ${daysToEnd}`
}
} }