diff --git a/components/cycle-day/symptoms/temperature.js b/components/cycle-day/symptoms/temperature.js index b9a3d5b..07761df 100644 --- a/components/cycle-day/symptoms/temperature.js +++ b/components/cycle-day/symptoms/temperature.js @@ -27,7 +27,8 @@ export default class Temp extends Component { this.state = { currentValue: initialValue, - exclude: this.cycleDay.temperature ? this.cycleDay.temperature.exclude : false + exclude: this.cycleDay.temperature ? this.cycleDay.temperature.exclude : false, + time: this.cycleDay.temperature ? this.cycleDay.temperature.time : null } } @@ -47,6 +48,17 @@ export default class Temp extends Component { value={this.state.currentValue} /> + + Time + { + this.setState({ time: val }) + }} + keyboardType='numeric' + value={this.state.time} + /> + Exclude { const dataToSave = { value: Number(this.state.currentValue), - exclude: this.state.exclude + exclude: this.state.exclude, + time: this.state.time || + LocalTime.now().truncatedTo(ChronoUnit.MINUTES).toString() } if (!cycleDay.temperature || cycleDay.temperature && !cycleDay.temperature.time) { const now = LocalTime.now().truncatedTo(ChronoUnit.MINUTES).toString() diff --git a/db.js b/db.js index c0533bf..e2cf940 100644 --- a/db.js +++ b/db.js @@ -6,7 +6,11 @@ const TemperatureSchema = { name: 'Temperature', properties: { value: 'double', - exclude: 'bool' + exclude: 'bool', + time: { + type: 'string', + optional: true + }, } }