Matt Basta
2017-10-15 f7c600bd2376534b979826791c60a82d01764b57
Fix for AM/PM toggle (fixes #446)
1 files modified
8 ■■■■■ changed files
src/TimeView.js 8 ●●●●● patch | view | raw | blame | history
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' ),