Fixes prediction range in drop on homescreen

This commit is contained in:
emelko
2019-04-23 20:44:59 +02:00
parent ded3a79bbc
commit dd24e6058f
+7 -1
View File
@@ -217,5 +217,11 @@ function getBleedingPredictionRange(prediction) {
if (todayDate.isAfter(bleedingEnd)) { if (todayDate.isAfter(bleedingEnd)) {
return labels.unknown return labels.unknown
} }
return '0' const daysToEnd = todayDate.until(bleedingEnd, ChronoUnit.DAYS)
if (daysToEnd === 0) {
return '0'
} else {
return `0 - ${daysToEnd}`
}
} }