Use new isCycleStartFunctions throughout cycle module

This commit is contained in:
Julia Friesel
2018-10-25 09:18:25 +02:00
parent ca4cccfd65
commit 9188d84797
4 changed files with 218 additions and 313 deletions
+3 -2
View File
@@ -9,16 +9,17 @@ import cycleModule from '../lib/cycle'
import {getCycleLengthStats as getCycleInfo} from '../lib/cycle-length'
import {stats as labels} from './labels'
import AppText from './app-text'
import { getCycleStartsSortedByDate } from '../db'
export default class Stats extends Component {
render() {
const allMensesStarts = cycleModule().getAllMensesStarts()
const allMensesStarts = getCycleStartsSortedByDate()
const atLeastOneCycle = allMensesStarts.length > 1
let cycleLengths
let numberOfCycles
let cycleInfo
if (atLeastOneCycle) {
cycleLengths = cycleModule().getCycleLength(allMensesStarts)
cycleLengths = cycleModule().getAllCycleLengths()
numberOfCycles = cycleLengths.length
if (numberOfCycles > 1) {
cycleInfo = getCycleInfo(cycleLengths)