Skip to content
Snippets Groups Projects
Commit 93abaf99 authored by emelko's avatar emelko
Browse files

Nicer formatting for past bleeding prediction

parent dd24e605
No related branches found
No related tags found
No related merge requests found
......@@ -7,3 +7,7 @@ export default function (date) {
const formattedDate = today.equals(dateToDisplay) ? 'today' : moment(date).format('MMMM Do YYYY')
return formattedDate.toLowerCase()
}
export function dateForShortDescription (date) {
return moment(date.toString()).format('dddd, MMMM Do')
}
\ No newline at end of file
......@@ -16,6 +16,7 @@ import { getFertilityStatusForDay } from '../lib/sympto-adapter'
import styles, { cycleDayColor, periodColor, secondaryColor } from '../styles'
import AppText from './app-text'
import Button from './button'
import { dateForShortDescription } from './helpers/format-date'
const ShowMoreToggler = ({ isShowingMore, onToggle }) => {
const {height, width} = Dimensions.get('window')
......@@ -193,7 +194,7 @@ function determinePredictionText(bleedingPrediction) {
}
if (todayDate.isAfter(bleedingEnd)) {
return predictLabels.predictionInPast(
bleedingStart.toString(), bleedingEnd.toString()
dateForShortDescription(bleedingStart), dateForShortDescription(bleedingEnd)
)
}
const daysToEnd = todayDate.until(bleedingEnd, ChronoUnit.DAYS)
......@@ -223,5 +224,4 @@ function getBleedingPredictionRange(prediction) {
} else {
return `0 - ${daysToEnd}`
}
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment