Skip to content
Snippets Groups Projects
Commit f9eb06f1 authored by Sofiya Tepikin's avatar Sofiya Tepikin
Browse files

Make use of formatWithOrdinalSuffix function

parent 9d3c3324
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,7 @@ import Button from './common/button' ...@@ -13,7 +13,7 @@ import Button from './common/button'
import cycleModule from '../lib/cycle' import cycleModule from '../lib/cycle'
import { getFertilityStatusForDay } from '../lib/sympto-adapter' import { getFertilityStatusForDay } from '../lib/sympto-adapter'
import { determinePredictionText, getOrdinalSuffix } from './helpers/home' import { determinePredictionText, formatWithOrdinalSuffix } from './helpers/home'
import { Colors, Fonts, Sizes, Spacing } from '../styles' import { Colors, Fonts, Sizes, Spacing } from '../styles'
import { home as labels } from '../i18n/en/labels' import { home as labels } from '../i18n/en/labels'
...@@ -37,10 +37,9 @@ class Home extends Component { ...@@ -37,10 +37,9 @@ class Home extends Component {
const prediction = getPredictedMenses() const prediction = getPredictedMenses()
this.cycleDayText = !this.cycleDayNumber ? labels.cycleDayNotEnoughInfo this.cycleDayText = !this.cycleDayNumber ? labels.cycleDayNotEnoughInfo
: `${this.cycleDayNumber}${getOrdinalSuffix(this.cycleDayNumber)}` : formatWithOrdinalSuffix(this.cycleDayNumber)
this.phase = phase this.phase = phase
this.phaseText = !phase ? statusText this.phaseText = !phase ? statusText : formatWithOrdinalSuffix(phase)
: `${phase}${getOrdinalSuffix(phase)}`
this.prediction = determinePredictionText(prediction) this.prediction = determinePredictionText(prediction)
this.status = status this.status = status
this.statusText = statusText this.statusText = statusText
......
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