<commit_before>import React from 'react';
import GregorianCalendar from 'gregorian-calendar';
import RangeCalendar from 'rc-calendar/lib/RangeCalendar';
import DatePicker from 'rc-calendar/lib/Picker';
import classNames from 'classnames';

export default React.createClass({
  getDefaultProps() {
    return {
      defaultValue: [],
      startPlaceholder: '开始日期',
      endPlaceholder: '结束日期',
    };
  },
  getInitialState() {
    const { value, defaultValue, parseDateFromValue } = this.props;
    const start = (value && value[0]) || defaultValue[0];
    const end = (value && value[1]) || defaultValue[1];
    return {
      value: [
        parseDateFromValue(start),
        parseDateFromValue(end)
      ]
    };
  },
  componentWillReceiveProps(nextProps) {
    if ('value' in nextProps) {
      const value = nextProps.value || [];
      const start = nextProps.parseDateFromValue(value[0]);
      const end = nextProps.parseDateFromValue(value[1]);
      this.setState({
        value: [start, end]
      });
    }
  },
  handleChange(value) {
    const props = this.props;
    if (!('value' in props)) {
      this.setState({ value });
    }
    const startDate = value[0] ? new Date(value[0].getTime()) : null;
    const endDate = value[1] ? new Date(value[1].getTime()) : null;
    const startDateString = value[0] ? props.getFormatter().format(value[0]) : '';
    const endDateString = value[1] ? props.getFormatter().format(value[1]) : '';
    props.props.onChange([startDate, endDate], [startDateString, endDateString]);
  },
  render() {
    const props = this.props;
    const locale = props.locale;<commit_msg>Fix RangePicker handleChange callback.<commit_after>import React from 'react';
import GregorianCalendar from 'gregorian-calendar';
import RangeCalendar from 'rc-calendar/lib/RangeCalendar';
import DatePicker from 'rc-calendar/lib/Picker';
import classNames from 'classnames';

export default React.createClass({
  getDefaultProps() {
    return {
      defaultValue: [],
      startPlaceholder: '开始日期',
      endPlaceholder: '结束日期',
    };
  },
  getInitialState() {
    const { value, defaultValue, parseDateFromValue } = this.props;
    const start = (value && value[0]) || defaultValue[0];
    const end = (value && value[1]) || defaultValue[1];
    return {
      value: [
        parseDateFromValue(start),
        parseDateFromValue(end)
      ]
    };
  },
  componentWillReceiveProps(nextProps) {
    if ('value' in nextProps) {
      const value = nextProps.value || [];
      const start = nextProps.parseDateFromValue(value[0]);
      const end = nextProps.parseDateFromValue(value[1]);
      this.setState({
        value: [start, end]
      });
    }
  },
  handleChange(value) {
    const props = this.props;
    if (!('value' in props)) {
      this.setState({ value });
    }
    const startDate = value[0] ? new Date(value[0].getTime()) : null;
    const endDate = value[1] ? new Date(value[1].getTime()) : null;
    const startDateString = value[0] ? props.getFormatter().format(value[0]) : '';
    const endDateString = value[1] ? props.getFormatter().format(value[1]) : '';
    props.onChange([startDate, endDate], [startDateString, endDateString]);
  },
  render() {
    const props = this.props;
    const locale = props.locale;
{'fraction_non_alphanumeric': 0.14568729046022555, 'fraction_numerical': 0.00853398354160317, 'mean_word_length': 3.3994638069705094, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5309811', 'n_tokens_mistral': 1002, 'n_tokens_neox': 1000, 'n_words': 220}