<commit_before>// Components

const InputDate = FocusComponents.components.input.Date;

class InputDateSample extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            date1 : moment().toISOString()
        }
    }

    changeHandler = (id) => {
        return value => {
            const validation = this.refs[`date${id}`].validate(value);
            if (validation.isValid) {
                this.setState({
                    [`date${id}`]: value
                });
            } else {
                this.setState({
                    [`date${id}`]: value,
                    [`error${id}`]: validation.message
                });
            }
        }
    }

    render = () => {
        const {date1, error1} = this.state;
        return (
            <div>
                <h3>With value</h3>
                <InputDate error={error1} name='date1' onChange={this.changeHandler(1)} ref='date1' value={date1} />
            </div>
        );
    }
}

return <InputDateSample/>;
<commit_msg>[input date] Fix example<commit_after>// Components

const InputDate = FocusComponents.components.input.Date;

class InputDateSample extends React.Component {
    constructor(props) {
        super(props);
        this.state = {
            date1 : moment().toISOString()
        }
    }

    changeHandler = (id) => {
        return value => {
            const {isValid, message} = this.refs[`date${id}`].validate(value);
                this.setState({
                    [`date${id}`]: value,
                    [`error${id}`]: isValid ? null : message
                });
        }
    }

    render = () => {
        const {date1, error1} = this.state;
        return (
            <div>
                <h3>With value</h3>
                <InputDate error={error1} name='date1' onChange={this.changeHandler(1)} ref='date1' value={date1} />
            </div>
        );
    }
}

return <InputDateSample/>;

{'fraction_non_alphanumeric': 0.1445966514459665, 'fraction_numerical': 0.010147133434804667, 'mean_word_length': 1.537966537966538, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 21, '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': '4759790', 'n_tokens_mistral': 561, 'n_tokens_neox': 557, 'n_words': 100}