<commit_before>import React, { useState, useRef, useEffect } from 'react';
import PropTypes from 'prop-types';
import I18n from 'i18n-js';
import 'react-day-picker/lib/style.css';
import LocaleUtils from 'react-day-picker/moment';
import DayPicker from 'react-day-picker';
import Browser from '../../../utils/helpers/browser/browser';
import DateHelper from '../../../utils/helpers/date/date';
import Portal from '../../../components/portal/portal';
import Navbar from './navbar';
import StyledDayPicker from './day-picker.style';

const DatePicker = (props) => {
  const window = Browser.getWindow();
  const [containerPosition, setContainerPosition] = useState(() => getContainerPosition(window, props.inputElement));
  const containerProps = {
    style: containerPosition
  };
  const datepicker = useRef(null);

  const datePickerProps = {
    disabledDays: getDisabledDays(props.minDate, props.maxDate),
    enableOutsideDays: true,
    fixedWeeks: true,
    initialMonth: props.selectedDate,
    inline: true,
    locale: I18n.locale,
    localeUtils: LocaleUtils,
    navbarElement: <Navbar />,
    onDayClick: handleDayClick,
    selectedDays: [props.selectedDate]
  };

  useEffect(() => {
    if (props.selectedDate && monthOrYearHasChanged(datepicker, props.selectedDate)) {
      datepicker.current.showMonth(props.selectedDate);
    }
  }, [props.selectedDate]);

  function handleDayClick(selectedDate, modifiers) {
    if (!modifiers.disabled) props.handleDateSelect(selectedDate);
  }

  return (
    <Portal onReposition={ () => setContainerPosition(getContainerPosition(window, props.inputElement)) }>
      <StyledDayPicker>
        <DayPicker
          { ...datePickerProps }
          containerProps={ containerProps }
          ref={ datepicker }
        />
      </StyledDayPicker>
    </Portal>
  );
};
<commit_msg>added missing weekday override<commit_after>import React, { useState, useRef, useEffect } from 'react';
import PropTypes from 'prop-types';
import I18n from 'i18n-js';
import 'react-day-picker/lib/style.css';
import LocaleUtils from 'react-day-picker/moment';
import DayPicker from 'react-day-picker';
import Browser from '../../../utils/helpers/browser/browser';
import DateHelper from '../../../utils/helpers/date/date';
import Portal from '../../../components/portal/portal';
import Navbar from './navbar';
import Weekday from './weekday/weekday.component';
import StyledDayPicker from './day-picker.style';

const DatePicker = (props) => {
  const window = Browser.getWindow();
  const [containerPosition, setContainerPosition] = useState(() => getContainerPosition(window, props.inputElement));
  const containerProps = {
    style: containerPosition
  };
  const datepicker = useRef(null);

  const datePickerProps = {
    disabledDays: getDisabledDays(props.minDate, props.maxDate),
    enableOutsideDays: true,
    fixedWeeks: true,
    initialMonth: props.selectedDate,
    inline: true,
    locale: I18n.locale,
    localeUtils: LocaleUtils,
    navbarElement: <Navbar />,
    onDayClick: handleDayClick,
    selectedDays: [props.selectedDate],
    weekdayElement: (weekdayElementProps) => {
      const { className, weekday, localeUtils } = weekdayElementProps;
      const weekdayLong = localeUtils.formatWeekdayLong(weekday);
      const weekdayShort = weekdayLong.substring(0, 3);

      return (
        <Weekday className={ className } title={ weekdayLong }>
          {weekdayShort}
        </Weekday>
      );
    }
  };

  useEffect(() => {
    if (props.selectedDate && monthOrYearHasChanged(datepicker, props.selectedDate)) {
      datepicker.current.showMonth(props.selectedDate);
    }
  }, [props.selectedDate]);

  function handleDayClick(selectedDate, modifiers) {
    if (!modifiers.disabled) props.handleDateSelect(selectedDate);
  }

  return (
    <Portal onReposition={ () => setContainerPosition(getContainerPosition(window, props.inputElement)) }>
      <StyledDayPicker>
        <DayPicker
          { ...datePickerProps }
          containerProps={ containerProps }
          ref={ datepicker }
        />
      </StyledDayPicker>
    </Portal>
  );
};

{'fraction_non_alphanumeric': 0.13275193798449614, 'fraction_numerical': 0.003391472868217054, 'mean_word_length': 3.68140589569161, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 26, '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': '2559426', 'n_tokens_mistral': 1209, 'n_tokens_neox': 1182, 'n_words': 257}