diff --git a/components/helpers/format-date.js b/components/helpers/format-date.js index 079ea4d434d7b87d0fd6575e013441094dec8f02..f600581e43dbc5b5f5ddf8635fdabbd59ab78254 100644 --- a/components/helpers/format-date.js +++ b/components/helpers/format-date.js @@ -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 diff --git a/components/home.js b/components/home.js index fcfb91c5d4aeeaee58e3e61217ee4ab722f83445..8aa51837fb9ac51d271883cc3184fcd0d59eaace 100644 --- a/components/home.js +++ b/components/home.js @@ -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