Matteo Milesi
2018-02-01 e6c8d275d5620ec39c48e900fc35b9b044d03f71
Use static property defaultProps instead of getDefaultProps. (#496)

* Use static property defaultProps instead of getDefaultProps.

* Use static property defaultProps instead of getDefaultProps. Fix for lint.
1 files modified
39 ■■■■ changed files
DateTime.js 39 ●●●● patch | view | raw | blame | history
DateTime.js
@@ -32,27 +32,6 @@
        closeOnTab: TYPES.bool
    },
    getDefaultProps: function() {
        var nof = function() {};
        return {
            className: '',
            defaultValue: '',
            inputProps: {},
            input: true,
            onFocus: nof,
            onBlur: nof,
            onChange: nof,
            onViewModeChange: nof,
            timeFormat: true,
            timeConstraints: {},
            dateFormat: true,
            strictParsing: true,
            closeOnSelect: false,
            closeOnTab: true,
            utc: false
        };
    },
    getInitialState: function() {
        var state = this.getStateFromProps( this.props );
@@ -448,6 +427,24 @@
    }
});
Datetime.defaultProps = {
    className: '',
    defaultValue: '',
    inputProps: {},
    input: true,
    onFocus: function() {},
    onBlur: function() {},
    onChange: function() {},
    onViewModeChange: function() {},
    timeFormat: true,
    timeConstraints: {},
    dateFormat: true,
    strictParsing: true,
    closeOnSelect: false,
    closeOnTab: true,
    utc: false
};
// Make moment accessible through the Datetime class
Datetime.moment = moment;