diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 3387b9f..64fb21d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ -image: jfr3000/docker-nativescript +image: node:8 # This folder is cached between builds # http://docs.gitlab.com/ce/ci/yaml/README.html#cache diff --git a/home.js b/home.js index 0ae1a4d..c02055e 100644 --- a/home.js +++ b/home.js @@ -4,19 +4,32 @@ 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 +