Nicolas Sandron
2018-03-26 26446a92e043d107681f1bf9194621fe30731a04
src/TimeView.js
@@ -27,17 +27,19 @@
         }
      }
      var hours = date.format( 'H' );
      var daypart = false;
      if ( this.state !== null && this.props.timeFormat.toLowerCase().indexOf( ' a' ) !== -1 ) {
         if ( this.props.timeFormat.indexOf( ' A' ) !== -1 ) {
            daypart = ( this.state.hours >= 12 ) ? 'PM' : 'AM';
            daypart = ( hours >= 12 ) ? 'PM' : 'AM';
         } else {
            daypart = ( this.state.hours >= 12 ) ? 'pm' : 'am';
            daypart = ( hours >= 12 ) ? 'pm' : 'am';
         }
      }
      return {
         hours: date.format( 'H' ),
         hours: hours,
         minutes: date.format( 'mm' ),
         seconds: date.format( 'ss' ),
         milliseconds: date.format( 'SSS' ),
@@ -179,9 +181,11 @@
            clearInterval( me.increaseTimer );
            me.props.setTime( type, me.state[ type ] );
            document.body.removeEventListener( 'mouseup', me.mouseUpListener );
            document.body.removeEventListener( 'touchend', me.mouseUpListener );
         };
         document.body.addEventListener( 'mouseup', me.mouseUpListener );
         document.body.addEventListener( 'touchend', me.mouseUpListener );
      };
   },