<commit_before>import React, { PropTypes } from 'react';
import { TransitionView, Calendar } from 'react-date-picker';

import Modal from '../Modal';


const propTypes = {
  open: PropTypes.bool.isRequired,
  defaultDate: PropTypes.string,
  onClose: PropTypes.func.isRequired,
  onChange: PropTypes.func.isRequired
};

const now = new Date();
const defaultProps = {
  defaultDate: now.toISOString().replace('T', ' ')
    .slice(0, -5)
};

const TimePickerModal = props => props.open &&
  <Modal onClose={props.onClose} className="time-picker">
    <div className="flex-col">
      <TransitionView>
        <Calendar
          dateFormat="YYYY-MM-DD HH:mm:ss"
          defaultDate={props.defaultDate}
          onChange={(dateString) =>
              props.onChange(dateString)}
        />
      </TransitionView>
      <button
        className="btn btn-primary btn--absolute"
        onClick={props.onClose}
      >
        Apply
      </button>
    </div>
  </Modal>;

TimePickerModal.propTypes = propTypes;
TimePickerModal.defaultProps = defaultProps;

export default TimePickerModal;
<commit_msg>Fix calendar modal default value<commit_after>import React, { PropTypes } from 'react';
import { TransitionView, Calendar } from 'react-date-picker';

import Modal from '../Modal';


const propTypes = {
  open: PropTypes.bool.isRequired,
  defaultDate: PropTypes.string,
  onClose: PropTypes.func.isRequired,
  onChange: PropTypes.func.isRequired
};

const TimePickerModal = props => props.open &&
  <Modal onClose={props.onClose} className="time-picker">
    <div className="flex-col">
      <TransitionView>
        <Calendar
          dateFormat="YYYY-MM-DD HH:mm:ss"
          defaultDate={props.defaultDate || ''}
          onChange={(dateString) =>
              props.onChange(dateString)}
        />
      </TransitionView>
      <button
        className="btn btn-primary btn--absolute"
        onClick={props.onClose}
      >
        Apply
      </button>
    </div>
  </Modal>;

TimePickerModal.propTypes = propTypes;

export default TimePickerModal;

{'fraction_non_alphanumeric': 0.1298449612403101, 'fraction_numerical': 0.0009689922480620155, 'mean_word_length': 3.001937984496124, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 25, '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': '6273067', 'n_tokens_mistral': 603, 'n_tokens_neox': 610, 'n_words': 126}