* Make string the default widget if none is specified * Linting fixes for PreviewPane * Linting fixes for ControlPane * Add date widget * Fix name of date control class * Fix spaces in list control with no fields * Fix linting error for List Control * Fix linting errors in raw editor * Add Select widget * Fix linting error
22 lines
466 B
JavaScript
22 lines
466 B
JavaScript
import React, { PropTypes } from 'react';
|
|
import DateTime from 'react-datetime';
|
|
|
|
export default class DateControl extends React.Component {
|
|
handleChange = (datetime) => {
|
|
this.props.onChange(datetime);
|
|
};
|
|
|
|
render() {
|
|
return (<DateTime
|
|
timeFormat={false}
|
|
value={this.props.value || new Date()}
|
|
onChange={this.handleChange}
|
|
/>);
|
|
}
|
|
}
|
|
|
|
DateControl.propTypes = {
|
|
onChange: PropTypes.func.isRequired,
|
|
value: PropTypes.object,
|
|
};
|