I have start_date and end_date pickers
from
https://www.npmjs.com/package/react-datetime
But when trying to pick up currently selected
start_date and end_date
I get
Missing class properties transform.
It was mentioned here
But I am not so sure how to resolve and have another component picking up these two instances of datetime?
client/components/main.jsx:
return (
<div>
<h3>Start Date</h3>
<MomentInputDemo/>
<h3>End Date</h3>
<MomentInputDemo/>
<FutureTasksForm />
client/components/MomentInputDemo.jsx
export default class MomentInputDemo extends TrackerReact(React.Component) {
constructor() {
super()
this.state = {time: ''}
this.handleChange = this.handleChange.bind(this);
}
handleChange = key => (newDate) => {
if (newDate !== 'Invalid date') {
this.setState({
[key]: newDate / 1000,
});
}
}
render() {
return '',
<DateTime
onChange={this.handleChange}
/>
}
client/components/FutureTaskForm.jsx:
Meteor.call('addTestTicket', text, (error, data)=> {
}
server/entry.jsx:
addTestTicket:
FutureTasks.insert({
userid: text, //'sec11'
start_date: ParentComponent.handleChange(), <= ??? How to call?
end_date: ParentComponent.handleChange() <= ??? How to call?
});