Simon Egersand
2018-02-07 de3fe15c59e7692eda6058a0dc8d0271acbcf3a3
example/formatChangeExample.js
@@ -5,30 +5,33 @@
var moment = require('moment');
var Wrapper = createClass({
   getInitialState: function() {
      return {
         dateFormat: 'YYYY-MM-DD'
      };
   },
  getInitialState: function() {
    return {
      dateFormat: 'YYYY-MM-DD'
    };
  },
   updateFormat: function(format) {
      console.log('changing state');
      this.setState({
         dateFormat: 'DD.MM.YYYY'
      });
   },
  updateFormat: function(format) {
    console.log('changing state');
    this.setState({
      dateFormat: 'DD.MM.YYYY'
    });
  },
   componentDidMount: function() {
      setTimeout(this.updateFormat, 2000);
   },
  componentDidMount: function() {
    setTimeout(this.updateFormat, 2000);
  },
   render: function() {
      return React.createElement(DateTime,
         { dateFormat: this.state.dateFormat, timeFormat: false, defaultValue: moment() });
   }
  render: function() {
    return React.createElement(DateTime, {
      dateFormat: this.state.dateFormat,
      timeFormat: false,
      defaultValue: moment()
    });
  }
});
ReactDOM.render(
   React.createElement(Wrapper),
   document.getElementById('datetime')
  React.createElement(Wrapper),
  document.getElementById('datetime')
);