title: Disable button if input date is lesser than 4 months
body: <p>I want to disable the next button when the input date is lesser than 4 months. Get the current date and check if the current date is lesser than 4 months. If it's lesser disable the next button and give an alert.</p>
  
  <p>I tried it with an alert button to test the datepicker, but that didn't work:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>jQuery(document).ready(function($) {
    $('#input_18_104').datepicker({
      onSelect: function() {
        var date = $(this).datepicker('getDate');
        var today = new Date();
        if ((new Date(today.getFullYear(), today.getMonth(), today.getDate() + 120)) &lt; date) {
          //Do somthing here..
          alert(123);
        }
  
      },
    });
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://code.jquery.com/ui/1.12.1/jquery-ui.min.js"&gt;&lt;/script&gt;
  &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.7.1/js/bootstrap-datepicker.min.js"&gt;&lt;/script&gt;
  &lt;link href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-datepicker/1.7.1/css/bootstrap-datepicker.css" rel="stylesheet" /&gt;
  
  &lt;input name="input_104" id="input_18_104" type="text" class="datepicker medium mdy datepicker_no_icon hasDatepicker" tabindex="72" placeholder="Date?"&gt; Next button:
  
  &lt;input type="button" id="next_button_18_94" class="form_next_button button" value="Next" tabindex="76"&gt;</code></pre>
  </div>
  </div>
  </p>