ComputedNfp => value
This commit is contained in:
@@ -62,7 +62,7 @@ export default class DayView extends Component {
|
|||||||
|
|
||||||
const mucusFeelingValue = this.cycleDay.mucus && this.cycleDay.mucus.feeling
|
const mucusFeelingValue = this.cycleDay.mucus && this.cycleDay.mucus.feeling
|
||||||
const mucusTextureValue = this.cycleDay.mucus && this.cycleDay.mucus.texture
|
const mucusTextureValue = this.cycleDay.mucus && this.cycleDay.mucus.texture
|
||||||
const mucusComputedValue = this.cycleDay.mucus && this.cycleDay.mucus.computedNfp
|
const mucusComputedValue = this.cycleDay.mucus && this.cycleDay.mucus.value
|
||||||
let mucusLabel
|
let mucusLabel
|
||||||
if (typeof mucusFeelingValue === 'number' && typeof mucusTextureValue === 'number') {
|
if (typeof mucusFeelingValue === 'number' && typeof mucusTextureValue === 'number') {
|
||||||
mucusLabel = `${feelingLabels[mucusFeelingValue]} + ${textureLabels[mucusTextureValue]} ( ${computeSensiplanMucusLabels[mucusComputedValue]} )`
|
mucusLabel = `${feelingLabels[mucusFeelingValue]} + ${textureLabels[mucusTextureValue]} ( ${computeSensiplanMucusLabels[mucusComputedValue]} )`
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ const MucusSchema = {
|
|||||||
properties: {
|
properties: {
|
||||||
feeling: 'int',
|
feeling: 'int',
|
||||||
texture: 'int',
|
texture: 'int',
|
||||||
computedNfp: 'int',
|
value: 'int',
|
||||||
exclude: 'bool'
|
exclude: 'bool'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+10
-4
@@ -8,12 +8,12 @@ export default function (dateString) {
|
|||||||
const cycle = getCycleDaysBeforeDay(dateString)
|
const cycle = getCycleDaysBeforeDay(dateString)
|
||||||
if (!cycle) return fertilityStatus.unknown
|
if (!cycle) return fertilityStatus.unknown
|
||||||
|
|
||||||
// we get earliest last, but sympto wants earliest first
|
|
||||||
cycle.reverse()
|
|
||||||
const previousCycles = getPreviousCycles(cycle[0])
|
const previousCycles = getPreviousCycles(cycle[0])
|
||||||
previousCycles.forEach(cycle => cycle.reverse())
|
|
||||||
|
|
||||||
const status = getFertilityStatus({cycle, previousCycles})
|
const status = getFertilityStatus({
|
||||||
|
cycle: formatCycleForSympto(cycle),
|
||||||
|
previousCycles: previousCycles.map(formatCycleForSympto)
|
||||||
|
})
|
||||||
|
|
||||||
return formatStatusForApp(status)
|
return formatStatusForApp(status)
|
||||||
}
|
}
|
||||||
@@ -24,4 +24,10 @@ function formatStatusForApp(status) {
|
|||||||
} else {
|
} else {
|
||||||
return fertilityStatus.infertile
|
return fertilityStatus.infertile
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function formatCycleForSympto(cycle) {
|
||||||
|
// we get earliest last, but sympto wants earliest first
|
||||||
|
cycle.reverse()
|
||||||
|
return cycle
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user