Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
Drip
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
backup
Drip
Commits
20dc238e
Commit
20dc238e
authored
6 years ago
by
emelko
Browse files
Options
Downloads
Patches
Plain Diff
Replacing mucus default with secondarySymptom
parent
1c2c45f8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/sympto/index.js
+4
-1
4 additions, 1 deletion
lib/sympto/index.js
lib/sympto/pre-ovulatory.js
+10
-6
10 additions, 6 deletions
lib/sympto/pre-ovulatory.js
with
14 additions
and
7 deletions
lib/sympto/index.js
+
4
−
1
View file @
20dc238e
...
@@ -16,7 +16,10 @@ export default function getSymptoThermalStatus(cycleInfo) {
...
@@ -16,7 +16,10 @@ export default function getSymptoThermalStatus(cycleInfo) {
// if there was no first higher measurement in the previous cycle,
// if there was no first higher measurement in the previous cycle,
// no infertile pre-ovulatory phase may be assumed
// no infertile pre-ovulatory phase may be assumed
if
(
previousCycle
)
{
if
(
previousCycle
)
{
const
statusForLast
=
getSymptoThermalStatus
({
cycle
:
previousCycle
})
const
statusForLast
=
getSymptoThermalStatus
({
cycle
:
previousCycle
,
secondarySymptom
:
secondarySymptom
})
if
(
statusForLast
.
temperatureShift
)
{
if
(
statusForLast
.
temperatureShift
)
{
const
preOvuPhase
=
getPreOvulatoryPhase
(
const
preOvuPhase
=
getPreOvulatoryPhase
(
cycle
,
cycle
,
...
...
This diff is collapsed.
Click to expand it.
lib/sympto/pre-ovulatory.js
+
10
−
6
View file @
20dc238e
...
@@ -12,7 +12,7 @@ export default function(cycle, previousCycles) {
...
@@ -12,7 +12,7 @@ export default function(cycle, previousCycles) {
const
maybePreOvuDays
=
cycle
.
slice
(
0
,
preOvuPhaseLength
).
filter
(
d
=>
{
const
maybePreOvuDays
=
cycle
.
slice
(
0
,
preOvuPhaseLength
).
filter
(
d
=>
{
return
d
.
date
<=
preOvuEndDate
return
d
.
date
<=
preOvuEndDate
})
})
const
preOvulatoryDays
=
getDaysUntilFertile
Mucus
(
maybePreOvuDays
)
const
preOvulatoryDays
=
getDaysUntilFertile
SecondarySymptom
(
maybePreOvuDays
)
// if mucus occurs on the 1st cycle day, there is no pre-ovu phase
// if mucus occurs on the 1st cycle day, there is no pre-ovu phase
if
(
!
preOvulatoryDays
.
length
)
return
null
if
(
!
preOvulatoryDays
.
length
)
return
null
...
@@ -34,13 +34,17 @@ export default function(cycle, previousCycles) {
...
@@ -34,13 +34,17 @@ export default function(cycle, previousCycles) {
}
}
}
}
function
getDaysUntilFertileMucus
(
days
)
{
function
getDaysUntilFertileSecondarySymptom
(
days
,
secondarySymptom
)
{
const
firstFertileMucusDayIndex
=
days
.
findIndex
(
day
=>
{
const
firstFertileSecondarySymptomDayIndex
=
days
.
findIndex
(
day
=>
{
return
day
.
mucus
&&
day
.
mucus
.
value
>
1
if
(
secondarySymptom
===
'
mucus
'
)
{
return
day
.
mucus
&&
day
.
mucus
.
value
>
1
}
else
if
(
secondarySymptom
===
'
cervix
'
)
{
return
day
.
cervix
&&
!
day
.
cervix
.
isClosedAndHard
}
})
})
if
(
firstFertile
Mucus
DayIndex
>
-
1
)
{
if
(
firstFertile
SecondarySymptom
DayIndex
>
-
1
)
{
return
days
.
slice
(
0
,
firstFertile
Mucus
DayIndex
)
return
days
.
slice
(
0
,
firstFertile
SecondarySymptom
DayIndex
)
}
}
return
days
return
days
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment