Simon Egersand
2017-07-29 cf3d9288c97e65fdc66500b5bdc18604f97f0b85
DateTime.js
@@ -2,11 +2,11 @@
var assign = require('object-assign'),
   PropTypes = require('prop-types'),
    createClass = require('create-react-class'),
   createClass = require('create-react-class'),
   moment = require('moment'),
   React = require('react'),
   CalendarContainer = require('./src/CalendarContainer')
;
   ;
var TYPES = PropTypes;
var Datetime = createClass({
@@ -68,7 +68,7 @@
      var formats = this.getFormats( props ),
         date = props.value || props.defaultValue,
         selectedDate, viewDate, updateOn, inputValue
      ;
         ;
      if ( date && typeof date === 'string' )
         selectedDate = this.localMoment( date, formats.datetime );
@@ -103,7 +103,7 @@
   },
   getUpdateOn: function( formats ) {
        if ( formats.date.match(/[lLD]/) ) {
      if ( formats.date.match(/[lLD]/) ) {
         return 'days';
      } else if ( formats.date.indexOf('M') !== -1 ) {
         return 'months';
@@ -120,7 +120,7 @@
            time: props.timeFormat || ''
         },
         locale = this.localMoment( props.date, null, props ).localeData()
      ;
         ;
      if ( formats.date === true ) {
         formats.date = locale.longDateFormat('L');
@@ -200,7 +200,7 @@
      var value = e.target === null ? e : e.target.value,
         localMoment = this.localMoment( value, this.state.inputFormat ),
         update = { inputValue: value }
      ;
         ;
      if ( localMoment.isValid() && !this.props.value ) {
         update.selectedDate = localMoment;
@@ -272,7 +272,7 @@
         state = this.state,
         date = (state.selectedDate || state.viewDate).clone(),
         nextType
      ;
         ;
      // It is needed to set all the time properties
      // to not to reset the time
@@ -297,7 +297,7 @@
         viewDate = this.state.viewDate,
         currentDate = this.state.selectedDate || viewDate,
         date
      ;
         ;
      if (target.className.indexOf('rdtDay') !== -1) {
         if (target.className.indexOf('rdtNew') !== -1)
@@ -386,7 +386,7 @@
      var me = this,
         formats = this.getFormats( this.props ),
         props = {dateFormat: formats.date, timeFormat: formats.time}
      ;
         ;
      this.componentProps.fromProps.forEach( function( name ) {
         props[ name ] = me.props[ name ];
@@ -407,8 +407,7 @@
      var className = 'rdt' + (this.props.className ?
                  ( Array.isArray( this.props.className ) ?
                  ' ' + this.props.className.join( ' ' ) : ' ' + this.props.className) : ''),
         children = []
      ;
         children = [];
      if ( this.props.input ) {
         children = [ React.createElement('input', assign({