<commit_before>import DateInput from './date_input'
import Calendar from './calendar'
import React from 'react'
import defer from 'lodash/defer'
import TetherComponent from './tether_component'
import classnames from 'classnames'
import { isSameDay } from './date_utils'
import moment from 'moment'
import onClickOutside from 'react-onclickoutside'

var outsideClickIgnoreClass = 'react-datepicker-ignore-onclickoutside'
var WrappedCalendar = onClickOutside(Calendar)

/**
 * General datepicker component.
 */

var DatePicker = React.createClass({
  displayName: 'DatePicker',

  propTypes: {
    autoComplete: React.PropTypes.string,
    autoFocus: React.PropTypes.bool,
    children: React.PropTypes.node,
    className: React.PropTypes.string,
    customInput: React.PropTypes.element,
    dateFormat: React.PropTypes.oneOfType([
      React.PropTypes.string,
      React.PropTypes.array
    ]),
    dateFormatCalendar: React.PropTypes.string,
    disabled: React.PropTypes.bool,
    dropdownMode: React.PropTypes.oneOf(['scroll', 'select']).isRequired,
    endDate: React.PropTypes.object,
    excludeDates: React.PropTypes.array,
    filterDate: React.PropTypes.func,
    fixedHeight: React.PropTypes.bool,
    highlightDates: React.PropTypes.array,
    id: React.PropTypes.string,
    includeDates: React.PropTypes.array,
    inline: React.PropTypes.bool,
    isClearable: React.PropTypes.bool,
    locale: React.PropTypes.string,
    maxDate: React.PropTypes.object,
    minDate: React.PropTypes.object,
    monthsShown: React.PropTypes.number,
    name: React.PropTypes.string,
    onBlur: React.PropTypes.func,
    onChange: React.PropTypes.func.isRequired,
    onFocus: React.PropTypes.func,
    onMonthChange: React.PropTypes.func,
    openToDate: React.PropTypes.object,
    peekNextMonth: React.PropTypes.bool,
    placeholderText: React.PropTypes.string,
    popoverAttachment: React.PropTypes.string,
    popoverTargetAttachment: React.PropTypes.string,
    popoverTargetOffset: React.PropTypes.string,
    readOnly: React.PropTypes.bool,
    renderCalendarTo: React.PropTypes.any,
    required: React.PropTypes.bool,
    scrollableYearDropdown: React.PropTypes.bool,
    selected: React.PropTypes.object,
    selectsEnd: React.PropTypes.bool,
    selectsStart: React.PropTypes.bool,
    showMonthDropdown: React.PropTypes.bool,
    showWeekNumbers: React.PropTypes.bool,
    showYearDropdown: React.PropTypes.bool,
    forceShowMonthNavigation: React.PropTypes.bool,
    startDate: React.PropTypes.object,
    tabIndex: React.PropTypes.number,
    tetherConstraints: React.PropTypes.array,
    title: React.PropTypes.string,
    todayButton: React.PropTypes.string,
    utcOffset: React.PropTypes.number
  },

  getDefaultProps () {
    return {
      dateFormatCalendar: 'MMMM YYYY',
      onChange () {},
      disabled: false,
      dropdownMode: 'scroll',
      onFocus () {},
      onBlur () {},
      onMonthChange () {},
      popoverAttachment: 'top left',
      popoverTargetAttachment: 'bottom left',
      popoverTargetOffset: '10px 0',
      tetherConstraints: [
        {
          to: 'window',
          attachment: 'together'
        }
      ],
      utcOffset: moment.utc().utcOffset(),
      monthsShown: 1
    }
  },

  getInitialState () {
    return {
      open: false,
      preventFocus: false
    }
  },

  setFocus () {
    this.refs.input.focus()
  },

  setOpen (open) {
    this.setState({ open })
  },

  handleFocus (event) {
    if (!this.state.preventFocus) {
      this.props.onFocus(event)
      this.setOpen(true)
    }
  },<commit_msg>Default value for utcOffset props should be moment().utcOffset() (#703)<commit_after>import DateInput from './date_input'
import Calendar from './calendar'
import React from 'react'
import defer from 'lodash/defer'
import TetherComponent from './tether_component'
import classnames from 'classnames'
import { isSameDay } from './date_utils'
import moment from 'moment'
import onClickOutside from 'react-onclickoutside'

var outsideClickIgnoreClass = 'react-datepicker-ignore-onclickoutside'
var WrappedCalendar = onClickOutside(Calendar)

/**
 * General datepicker component.
 */

var DatePicker = React.createClass({
  displayName: 'DatePicker',

  propTypes: {
    autoComplete: React.PropTypes.string,
    autoFocus: React.PropTypes.bool,
    children: React.PropTypes.node,
    className: React.PropTypes.string,
    customInput: React.PropTypes.element,
    dateFormat: React.PropTypes.oneOfType([
      React.PropTypes.string,
      React.PropTypes.array
    ]),
    dateFormatCalendar: React.PropTypes.string,
    disabled: React.PropTypes.bool,
    dropdownMode: React.PropTypes.oneOf(['scroll', 'select']).isRequired,
    endDate: React.PropTypes.object,
    excludeDates: React.PropTypes.array,
    filterDate: React.PropTypes.func,
    fixedHeight: React.PropTypes.bool,
    highlightDates: React.PropTypes.array,
    id: React.PropTypes.string,
    includeDates: React.PropTypes.array,
    inline: React.PropTypes.bool,
    isClearable: React.PropTypes.bool,
    locale: React.PropTypes.string,
    maxDate: React.PropTypes.object,
    minDate: React.PropTypes.object,
    monthsShown: React.PropTypes.number,
    name: React.PropTypes.string,
    onBlur: React.PropTypes.func,
    onChange: React.PropTypes.func.isRequired,
    onFocus: React.PropTypes.func,
    onMonthChange: React.PropTypes.func,
    openToDate: React.PropTypes.object,
    peekNextMonth: React.PropTypes.bool,
    placeholderText: React.PropTypes.string,
    popoverAttachment: React.PropTypes.string,
    popoverTargetAttachment: React.PropTypes.string,
    popoverTargetOffset: React.PropTypes.string,
    readOnly: React.PropTypes.bool,
    renderCalendarTo: React.PropTypes.any,
    required: React.PropTypes.bool,
    scrollableYearDropdown: React.PropTypes.bool,
    selected: React.PropTypes.object,
    selectsEnd: React.PropTypes.bool,
    selectsStart: React.PropTypes.bool,
    showMonthDropdown: React.PropTypes.bool,
    showWeekNumbers: React.PropTypes.bool,
    showYearDropdown: React.PropTypes.bool,
    forceShowMonthNavigation: React.PropTypes.bool,
    startDate: React.PropTypes.object,
    tabIndex: React.PropTypes.number,
    tetherConstraints: React.PropTypes.array,
    title: React.PropTypes.string,
    todayButton: React.PropTypes.string,
    utcOffset: React.PropTypes.number
  },

  getDefaultProps () {
    return {
      dateFormatCalendar: 'MMMM YYYY',
      onChange () {},
      disabled: false,
      dropdownMode: 'scroll',
      onFocus () {},
      onBlur () {},
      onMonthChange () {},
      popoverAttachment: 'top left',
      popoverTargetAttachment: 'bottom left',
      popoverTargetOffset: '10px 0',
      tetherConstraints: [
        {
          to: 'window',
          attachment: 'together'
        }
      ],
      utcOffset: moment().utcOffset(),
      monthsShown: 1
    }
  },

  getInitialState () {
    return {
      open: false,
      preventFocus: false
    }
  },

  setFocus () {
    this.refs.input.focus()
  },

  setOpen (open) {
    this.setState({ open })
  },

  handleFocus (event) {
    if (!this.state.preventFocus) {
      this.props.onFocus(event)
      this.setOpen(true)
    }
  },
{'fraction_non_alphanumeric': 0.1116182572614108, 'fraction_numerical': 0.0015214384508990318, 'mean_word_length': 3.449846153846154, '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': '5857046', 'n_tokens_mistral': 2234, 'n_tokens_neox': 2203, 'n_words': 414}