From f9eb06f197b2254d7fc3898df0a9f6a47450c266 Mon Sep 17 00:00:00 2001 From: Sofiya Tepikin Date: Fri, 4 Dec 2020 19:30:41 +0100 Subject: [PATCH] Make use of formatWithOrdinalSuffix function --- components/home.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/components/home.js b/components/home.js index 2444194..aabd81b 100644 --- a/components/home.js +++ b/components/home.js @@ -13,7 +13,7 @@ import Button from './common/button' import cycleModule from '../lib/cycle' 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 { home as labels } from '../i18n/en/labels' @@ -37,10 +37,9 @@ class Home extends Component { const prediction = getPredictedMenses() this.cycleDayText = !this.cycleDayNumber ? labels.cycleDayNotEnoughInfo - : `${this.cycleDayNumber}${getOrdinalSuffix(this.cycleDayNumber)}` + : formatWithOrdinalSuffix(this.cycleDayNumber) this.phase = phase - this.phaseText = !phase ? statusText - : `${phase}${getOrdinalSuffix(phase)}` + this.phaseText = !phase ? statusText : formatWithOrdinalSuffix(phase) this.prediction = determinePredictionText(prediction) this.status = status this.statusText = statusText