<commit_before>import React, { Component, PropTypes } from 'react';
import DatePicker from 'react-native-datepicker';
import { JA_DATEPICKER_TYPE } from '../../../resources/constants';

import styles from './style';
import I18n from '../../../i18n';

export default class JADatePicker extends Component {
  static propTypes = {
    typeOfInput: PropTypes.oneOfType(JA_DATEPICKER_TYPE).isRequired,
    onChange: PropTypes.func.isRequired,
    currentPickerValue: PropTypes.string,
  }

  static defaultProps = {
    currentPickerValue: '',
  }

  onSelection = (pickerSelection) => {
    this.props.onChange(pickerSelection);
  }

  render() {
    let pickerMode;
    let placeholder;
    let pickerFormat;
    switch (this.props.typeOfInput) {
      case JA_DATEPICKER_TYPE.DATE:
        pickerMode = 'date';
        placeholder = I18n.t('date_and_time.select_date');
        pickerFormat = 'YYYY-MM-DD';<commit_msg>Fix typechecking of typeOfInput<commit_after>import React, { Component, PropTypes } from 'react';
import DatePicker from 'react-native-datepicker';
import { JA_DATEPICKER_TYPE } from '../../../resources/constants';

import styles from './style';
import I18n from '../../../i18n';

export default class JADatePicker extends Component {
  static propTypes = {
    typeOfInput: PropTypes.oneOf(Object.values(JA_DATEPICKER_TYPE)).isRequired,
    onChange: PropTypes.func.isRequired,
    currentPickerValue: PropTypes.string,
  }

  static defaultProps = {
    currentPickerValue: '',
  }

  onSelection = (pickerSelection) => {
    this.props.onChange(pickerSelection);
  }

  render() {
    let pickerMode;
    let placeholder;
    let pickerFormat;
    switch (this.props.typeOfInput) {
      case JA_DATEPICKER_TYPE.DATE:
        pickerMode = 'date';
        placeholder = I18n.t('date_and_time.select_date');
        pickerFormat = 'YYYY-MM-DD';
{'fraction_non_alphanumeric': 0.12412681354110693, 'fraction_numerical': 0.006448146157979581, 'mean_word_length': 3.574938574938575, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '5519977', 'n_tokens_mistral': 581, 'n_tokens_neox': 571, 'n_words': 120}