Nicer formatting for past bleeding prediction
This commit is contained in:
@@ -7,3 +7,7 @@ export default function (date) {
|
|||||||
const formattedDate = today.equals(dateToDisplay) ? 'today' : moment(date).format('MMMM Do YYYY')
|
const formattedDate = today.equals(dateToDisplay) ? 'today' : moment(date).format('MMMM Do YYYY')
|
||||||
return formattedDate.toLowerCase()
|
return formattedDate.toLowerCase()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function dateForShortDescription (date) {
|
||||||
|
return moment(date.toString()).format('dddd, MMMM Do')
|
||||||
|
}
|
||||||
+2
-2
@@ -16,6 +16,7 @@ import { getFertilityStatusForDay } from '../lib/sympto-adapter'
|
|||||||
import styles, { cycleDayColor, periodColor, secondaryColor } from '../styles'
|
import styles, { cycleDayColor, periodColor, secondaryColor } from '../styles'
|
||||||
import AppText from './app-text'
|
import AppText from './app-text'
|
||||||
import Button from './button'
|
import Button from './button'
|
||||||
|
import { dateForShortDescription } from './helpers/format-date'
|
||||||
|
|
||||||
const ShowMoreToggler = ({ isShowingMore, onToggle }) => {
|
const ShowMoreToggler = ({ isShowingMore, onToggle }) => {
|
||||||
const {height, width} = Dimensions.get('window')
|
const {height, width} = Dimensions.get('window')
|
||||||
@@ -193,7 +194,7 @@ function determinePredictionText(bleedingPrediction) {
|
|||||||
}
|
}
|
||||||
if (todayDate.isAfter(bleedingEnd)) {
|
if (todayDate.isAfter(bleedingEnd)) {
|
||||||
return predictLabels.predictionInPast(
|
return predictLabels.predictionInPast(
|
||||||
bleedingStart.toString(), bleedingEnd.toString()
|
dateForShortDescription(bleedingStart), dateForShortDescription(bleedingEnd)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
const daysToEnd = todayDate.until(bleedingEnd, ChronoUnit.DAYS)
|
const daysToEnd = todayDate.until(bleedingEnd, ChronoUnit.DAYS)
|
||||||
@@ -223,5 +224,4 @@ function getBleedingPredictionRange(prediction) {
|
|||||||
} else {
|
} else {
|
||||||
return `0 - ${daysToEnd}`
|
return `0 - ${daysToEnd}`
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user