Add edit bleeding and persist it.

This commit is contained in:
Julia Friesel
2018-06-05 16:37:06 +02:00
parent ecc4acf366
commit 090f4116d5
7 changed files with 141 additions and 13 deletions
+4 -6
View File
@@ -2,8 +2,8 @@ import React, { Component } from 'react'
import {
View, Button, DatePickerAndroid
} from 'react-native'
import moment from 'moment'
import * as styles from './styles'
import { getOrCreateCycleDay } from './db'
export default class DatePickView extends Component {
constructor(props) {
@@ -15,12 +15,10 @@ export default class DatePickView extends Component {
date: new Date()
})
if (result.action !== DatePickerAndroid.dismissedAction) {
const date = new Date(result.year, result.month, result.day)
const cycleDay = getOrCreateCycleDay(date)
const navigate = this.props.navigation.navigate
// continue here and actually make that view
navigate(
'dayView',
{ date: moment(new Date(result.year, result.month, result.day)) }
)
navigate('dayView', { cycleDay })
}
}