How to use the react-moment-proptypes.momentString function in react-moment-proptypes

To help you get started, we’ve selected a few react-moment-proptypes examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kuzzmi / react-better-date-picker / src / react-better-date-picker.js View on Github external
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,

react-moment-proptypes

React proptype for moment module

MIT
Latest version published 4 years ago

Package Health Score

53 / 100
Full package analysis