Adds comment for bleeding prediction ranges

This commit is contained in:
emelko
2019-05-10 13:11:36 +02:00
parent ea36d4ec7a
commit bc0d36ed54
+2 -1
View File
@@ -179,9 +179,10 @@ export default class Home extends Component {
}
}
function getTimes(prediction) {
function getTimes(prediction) {
const todayDate = LocalDate.now()
const predictedBleedingStart = LocalDate.parse(prediction[0][0])
/* the range of predicted bleeding days can be either 3 or 5 */
const predictedBleedingEnd = LocalDate.parse(prediction[0][ prediction[0].length - 1 ])
const daysToEnd = todayDate.until(predictedBleedingEnd, ChronoUnit.DAYS)
return { todayDate, predictedBleedingStart, predictedBleedingEnd, daysToEnd }