Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import moment from 'moment';
// import onClickOutside from 'react-onclickoutside';
import { WeeksView, MonthsView, YearsView } from './views.js';
import { getMomentOrNull, getYearsInterval } from './utils.js';
import config from './config.js';
import defaultClasses from './classes.js';
import defaults from './defaults.js';
class BetterDatePicker extends Component {
static propTypes = {
date: PropTypes.oneOfType([
MomentPropTypes.momentObj,
MomentPropTypes.momentString,
PropTypes.instanceOf(Date)
]),
onChange: PropTypes.func.isRequired,
placeholder: PropTypes.string,
classes: PropTypes.object,
view: PropTypes.oneOf(['weeks', 'months', 'years']),
views: PropTypes.arrayOf(PropTypes.oneOf(['weeks', 'months', 'years'])),
firstDayOfWeek: PropTypes.number,
theme: PropTypes.object
};
static defaultProps = {
classes: defaultClasses,
format: defaults.format,
views: ['weeks', 'months', 'years'],
firstDayOfWeek: 0,