<commit_before>import React from 'react'
import DateTime from 'react-datetime'

let datePickerCount = 0
export default function DatePicker(p) {
  // Run once on mount and cleanup on unmount
  React.useEffect(() => {
    datePickerCount++
    return () => datePickerCount--
  }, [])

  function onChange(date) {
    // If the date hasjust been cleared, don't save it
    if (!date || !date.toISOString) return
    // grab just the date portion of the ISO
    // ISO is in UTC, see comment below
    p.onChange(date.toISOString().split('T')[0])
  }

  return (
    <DateTime
      type='date'
      closeOnSelect
      value={new Date(p.value)}
      timeFormat={false}
      inputProps={{
        disabled: p.disabled,
        id: `date-picker-${datePickerCount}`
      }}
      utc // because new Date('2016-12-12') yields a date at midnight UTC
      onChange={onChange}
    /><commit_msg>fix(analysis): Set date to YYYY-MM-DD format<commit_after>import React from 'react'
import DateTime from 'react-datetime'

let datePickerCount = 0
export default function DatePicker(p) {
  // Run once on mount and cleanup on unmount
  React.useEffect(() => {
    datePickerCount++
    return () => datePickerCount--
  }, [])

  function onChange(date) {
    // If the date hasjust been cleared, don't save it
    if (!date || !date.toISOString) return
    // grab just the date portion of the ISO
    // ISO is in UTC, see comment below
    p.onChange(date.toISOString().split('T')[0])
  }

  return (
    <DateTime
      dateFormat='YYYY-MM-DD'
      type='date'
      closeOnSelect
      value={new Date(p.value)}
      timeFormat={false}
      inputProps={{
        disabled: p.disabled,
        id: `date-picker-${datePickerCount}`
      }}
      utc // because new Date('2016-12-12') yields a date at midnight UTC
      onChange={onChange}
    />
{'fraction_non_alphanumeric': 0.1249321021184139, 'fraction_numerical': 0.010863661053775122, 'mean_word_length': 2.721212121212121, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, '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': '5369511', 'n_tokens_mistral': 569, 'n_tokens_neox': 560, 'n_words': 168}