<commit_before>import React from 'react';


var Time = (props) => {
    let time = props.time;

    let hour = time.hour;

    if (!props.hourFormat24 && time.pm) {
        let pad = function (n) {
            return (n < 10) ? `0${n}` : n.toString();
        };

        hour = pad(hour -= 12);
    }

    return (
        <h1 className='colours__time'>
            {hour} : {time.minute} : {time.second}
            {!props.hourFormat24 && <span className='colours__time__postfix'>{time.pm ? 'PM' : 'AM'}</span>}
        </h1>
    );
}

export default Time;<commit_msg>Fix 12PM/AM displaying as 00<commit_after>import React from 'react';


var Time = (props) => {
    let time = props.time;

    let hour = time.hour;

    if (!props.hourFormat24 && time.pm) {
        let pad = function (n) {
            return (n < 10) ? `0${n}` : n.toString();
        };

        hour -= 12;

        hour = pad(hour === 0 ? 12 : hour);
    }

    return (
        <h1 className='colours__time'>
            {hour} : {time.minute} : {time.second}
            {!props.hourFormat24 && <span className='colours__time__postfix'>{time.pm ? 'PM' : 'AM'}</span>}
        </h1>
    );
}

export default Time;
{'fraction_non_alphanumeric': 0.1722689075630252, 'fraction_numerical': 0.024369747899159664, 'mean_word_length': 2.038265306122449, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2961236', 'n_tokens_mistral': 429, 'n_tokens_neox': 398, 'n_words': 93}