title: React date picker filtering dates issue
body: <p>I'm using <a href="https://reactdatepicker.com" rel="nofollow noreferrer">https://reactdatepicker.com</a></p>
  
  <p>I seem to be having an issue in <strong>restricting weekends</strong> as shown in the example.</p>
  
  <p>I'm using class component and trying to implement this functional <strong>example</strong> from the <a href="https://reactdatepicker.com/#example-filter-dates" rel="nofollow noreferrer">docs</a>:</p>
  
  <p><strong>Example from docs:</strong></p>
  
  <pre><code>() =&gt; {
    const [startDate, setStartDate] = useState(null);
    const isWeekday = date =&gt; {
      const day = getDay(date);
      return day !== 0 &amp;&amp; day !== 6;
    };
    return (
      &lt;DatePicker
        selected={startDate}
        onChange={date =&gt; setStartDate(date)}
        filterDate={isWeekday}
        placeholderText="Select a weekday"
      /&gt;
    );
  };
  </code></pre>
  
  <p><strong>Here is what I tried:</strong> I created the <code>isWeekday</code> function and passed it to the <code>DatePicker</code>.</p>
  
  <pre><code>import React from 'react'
  import DatePicker from 'react-datepicker'
  import getDay from 'react-datepicker'
  import 'react-datepicker/dist/react-datepicker.css'
  
  const isWeekday = (date) =&gt; {
    const day = getDay(date)
    return day !== 0 &amp;&amp; day !== 6
  }
  
  export class Random extends React.Component {
    constructor(props) {
      super(props)
      this.state = {
        settlementDate: new Date(),
      }
    }
  
    render() {
      &lt;DatePicker
        selected={this.state.settlementDate}
        onChange={(date) =&gt; this.setState({ settlementDate: date })}
        minDate={new Date()}
        filterDate={isWeekday}
      /&gt;
    }
  }
  </code></pre>
  
  <p>But I get the following error:</p>
  
  <blockquote>
    <p>TypeError: Cannot call a class as a function</p>
  </blockquote>
  
  <p>How can I make a datepicker with weekends restricted?</p>