Cleanup
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import getFertilityStatus from './sympto'
|
||||
import cycleModule from './cycle'
|
||||
import { fertilityStatus } from '../labels/labels'
|
||||
|
||||
const { getCycleDaysBeforeDay, getPreviousCycles } = cycleModule()
|
||||
|
||||
export default function (dateString) {
|
||||
const cycle = getCycleDaysBeforeDay(dateString)
|
||||
if (!cycle) return `We cannot show any cycle information because no menses has been entered`
|
||||
if (!cycle) return fertilityStatus.unknown
|
||||
|
||||
// we get earliest last, but sympto wants earliest first
|
||||
cycle.reverse()
|
||||
@@ -18,5 +19,9 @@ export default function (dateString) {
|
||||
}
|
||||
|
||||
function formatStatusForApp(status) {
|
||||
return status.assumeFertility ? 'fertile' : 'infertile'
|
||||
if (status.assumeFertility) {
|
||||
return fertilityStatus.fertile
|
||||
} else {
|
||||
return fertilityStatus.infertile
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user