<commit_before>'use strict';

import React from 'react';
import DatePicker from 'material-ui/DatePicker';
import { connect } from 'react-redux';

let Datepicker = React.createClass({
  propTypes: {
    id: React.PropTypes.string,
    date: React.PropTypes.string,
    config: React.PropTypes.object,
    callback: React.PropTypes.func
  },

  render() {
    let { id, date, config, callback } = this.props;

    return (
      <DatePicker
        key={id}
        name={id}
        style={{paddingRight: 10}}
        textFieldStyle={{width: 120}}
        inputStyle={{color: 'white'}}
        locale={config.locale}
        DateTimeFormat={global.Intl.DateTimeFormat}
        autoOk={true}
        container="inline"
        value={new Date(date)}
        onChange={callback}
      />
    );
  }
});

export default connect(state => ({ config: state.config }))(Datepicker);<commit_msg>using reselect to simplify the datepicker component<commit_after>'use strict';

import React from 'react';
import DatePicker from 'material-ui/DatePicker';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';

let Datepicker = React.createClass({
  render() {
    return (
      <DatePicker
        {...this.props}
        style={{paddingRight: 10}}
        textFieldStyle={{width: 120}}
        inputStyle={{color: 'white'}}
        DateTimeFormat={global.Intl.DateTimeFormat}
        autoOk={true}
        container="inline"
      />
    );
  }
});

export default connect(
  (state, props) => ({
    props,
    config: state.config
  }),
  {},
  createSelector(
    state => state.props,
    state => state.config,
    (props, config) => ({
      key: props.id,
      name: props.id,
      locale: config.locale,
      value: new Date(props.date),
      onChange: props.callback
    })
  )
)(Datepicker);
{'fraction_non_alphanumeric': 0.14332784184514002, 'fraction_numerical': 0.0054914881933003845, 'mean_word_length': 2.7644628099173554, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 10, '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': '7193700', 'n_tokens_mistral': 552, 'n_tokens_neox': 546, 'n_words': 122}