<commit_before>import React from 'react';
import fakeImport from 'moment/locale/fr.js';
import {DatePicker, DatePickerInput} from '../src';

const Example = React.createClass({

  propTypes: {},

  getInitialState() {
    return {
      datePickerDate: null,
      datePickerInputDate: null,
      showInput: true
    };
  },

  toggleInput() {
    this.setState({
      showInput: !this.state.showInput
    });
  },

  log(x) {
    console.log(x);
  },

  render() {
    return (
      <div style={{margin: 20}}>

        <h1>DatePickerInput</h1>
        <button onClick={this.toggleInput}>toggle DatePickerInput</button>
        <p>onChange(jsDate, dateString)</p>
        <p>dateString = "{this.state.datePickerInputDate}"</p>
        {this.state.showInput &&
          <div className='ui input'>
            <DatePickerInput
              className='my-react-component'
              onChange={(jsDate, dateString) => this.setState({datePickerInputDate: dateString})}
              onShow={this.log.bind(this, 'show')}
              onHide={this.log.bind(this, 'hide')}
              showOnInputClick
              placeholder='placeholder'
              locale='de'
              iconClassName='calendar icon'/>
          </div>
        }

        <h1>DatePicker (fixed calendar component)</h1>
        <p>onChange(jsDate)</p>
        <p>jsDate = {String(this.state.datePickerDate)}</p>
        <DatePicker
          className='my-react-datepicker'
          locale='fr'
          onChange={(jsDate) => this.setState({datePickerDate: jsDate})}/><commit_msg>improved examples<commit_after>import React from 'react/addons';
import fakeImport from 'moment/locale/fr.js';
import {DatePicker, DatePickerInput} from '../src';

const Example = React.createClass({

  propTypes: {},

  mixins: [React.addons.LinkedStateMixin],

  getInitialState() {
    return {
      datePickerDate: null,
      datePickerInputDate: null,
      datePickerInputDate2: null,
      showInput: true
    };
  },

  toggleInput() {
    this.setState({
      showInput: !this.state.showInput
    });
  },

  log(x) {
    console.log(x);
  },

  onChange2(a, b) {
    this.setState({datePickerInputDate2: a});
  },

  render() {
    return (
      <div style={{margin: 20}}>

        <h1>DatePickerInput</h1>
        <button onClick={this.toggleInput}>toggle DatePickerInput</button>
        <p>onChange(jsDate, dateString)</p>
        <p>dateString = "{this.state.datePickerInputDate}"</p>
        {this.state.showInput &&
          <div className='ui input'>
            <DatePickerInput
              className='my-react-component'
              onChange={(jsDate, dateString) => this.setState({datePickerInputDate: dateString})}
              onShow={this.log.bind(this, 'show')}
              onHide={this.log.bind(this, 'hide')}
              showOnInputClick
              placeholder='placeholder'
              locale='de'
              iconClassName='calendar icon'/>
          </div>
        }

        <h1>DatePicker (fixed calendar component)</h1>
        <p>onChange(jsDate)</p>
        <p>jsDate = {String(this.state.datePickerDate)}</p>
        <DatePicker
          className='my-react-datepicker'
          locale='fr'
          onChange={(jsDate) => this.setState({datePickerDate: jsDate})}/>

        <p></p>
        <p>VALUE LINK</p>
        <p>jsDate = {String(this.state.datePickerInputDate2)}</p>
        <div className='ui input'>
          <DatePickerInput
            className='my-react-component'
            valueLink={{value: this.state.datePickerInputDate2, requestChange: this.onChange2}}
            showOnInputClick
            placeholder='placeholder'
            locale='de'
            iconClassName='calendar icon'/>
        </div>
{'fraction_non_alphanumeric': 0.1425901201602136, 'fraction_numerical': 0.004806408544726302, 'mean_word_length': 2.344642857142857, 'pattern_counts': {'":': 0, '<': 50, '<?xml version=': 0, '>': 54, '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': '3907541', 'n_tokens_mistral': 1118, 'n_tokens_neox': 1109, 'n_words': 182}