import React from 'react';
import Div from './DateTime';
import MaterialDateTimePicker from 'material-datetime-picker';

class DateTime extends React.Component { // eslint-disable-line react/prefer-stateless-function
	constructor(){
		super();
		this.state = {
			'picker':null
		}
	}
	componentDidMount() {
		const picker = new MaterialDateTimePicker()
		.on('submit', (val) => console.log(`data: ${val}`))
		.on('open', () => console.log('opened'))
		.on('close', () => console.log('closed'));
		this.setState({'picker':picker});
	}
	render() {
		return(
			<input className="c-datepicker-input" onClick={()=>{this.state.picker.open()}}/>
		);
	}
}

export default DateTime;
