title: How to disable previous dates in jQuery datepicker using boolean condition?
body: <p>I'm trying to disable my datepicker using boolean condition but all my attempts don't work. If I enter <code>startDate: new Date()</code> in 'month-picker' It works as it should work.</p>
  <pre class="lang-js prettyprint-override"><code>$('.month-picker').datepicker({
      autoclose: true,
      format: &quot;dd.mm.yyyy&quot;,
      startView: &quot;year&quot;,
      minViewMode: &quot;months&quot;
     // startDate: new Date();
  });
      
  let initDate = function () {
  
      let anyYearAllowed = true;
  
      let iptDateFrom = $(&quot;#iptDateFrom&quot;).datepicker(&quot;setDate&quot;, new Date());
  
      if (anyYearAllowed) {
  
        // disable next dates
  
      } else {
        
         // disable previous dates
      }
  };
  </code></pre>
  <pre class="lang-html prettyprint-override"><code> &lt;input type=&quot;text&quot; id=&quot;iptDateFrom&quot; class=&quot;form-control month-picker&quot;
   value=&quot;${.now?datetime?string('dd.mm.yyyy')}&quot; style=&quot;width: 34%&quot; required/&gt;
  </code></pre>