Simon Egersand
2018-02-01 80582080ed523fcb9f85300438e066b76a008a4f
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 );
@@ -152,7 +131,9 @@
      }
      if ( updatedState.open === undefined ) {
         if ( this.props.closeOnSelect && this.state.currentView !== 'time' ) {
         if ( typeof nextProps.open !== 'undefined' ) {
            updatedState.open = nextProps.open;
         } else if ( this.props.closeOnSelect && this.state.currentView !== 'time' ) {
            updatedState.open = false;
         } else {
            updatedState.open = this.state.open;
@@ -426,7 +407,7 @@
            value: this.state.inputValue,
         }, this.props.inputProps);
         if ( this.props.renderInput ) {
            children = [ React.createElement('div', { key: 'i' }, this.props.renderInput( finalInputProps, this.openCalendar )) ];
            children = [ React.createElement('div', { key: 'i' }, this.props.renderInput( finalInputProps, this.openCalendar, this.closeCalendar )) ];
         } else {
            children = [ React.createElement('input', assign({ key: 'i' }, finalInputProps ))];
         }
@@ -446,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;