diff --git a/home.js b/home.js index 3552246..c32e26a 100644 --- a/home.js +++ b/home.js @@ -4,21 +4,30 @@ import { Button, Text } from 'react-native' +import { LocalDate } from 'js-joda' import styles from './styles' import getCycleDay from './get-cycle-day' +import { getOrCreateCycleDay } from './db' export default class Home extends Component { constructor(props) { super(props) } + passTodayToDayView() { + const todayDateString = LocalDate.now().toString() + const cycleDay = getOrCreateCycleDay(todayDateString) + const navigate = this.props.navigation.navigate + navigate('dayView', { cycleDay }) + } + render() { const navigate = this.props.navigation.navigate return ( Welcome! Today is day {getCycleDay()} of your current cycle