title: Why My Min and Max date setting not working in my date picker?
body: <p>I previously asked question to set one date picker dates with respect to month/year change of another date picker. I didn't get exact answer, but somehow I managed to get min and max dates to set to a date picker by referring various stack overflow answers. But that min and max date settings are not working properly.</p>
  
  <p>Month and year picking date picker:</p>
  
  <pre><code> &lt;label&gt; Month&lt;/label&gt;
   &lt;div class="input-group date"&gt;
      &lt;input type="text" class="form-control pull-right" id="txtMonth" onchange="MonthDatePick();"&gt;
      &lt;div class="input-group-addon"&gt;
          &lt;i class="fa fa-calendar"&gt;&lt;/i&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>My selected month date picking datepicker:</p>
  
  <pre><code>&lt;div class="col-lg-3"&gt;
      &lt;label&gt; From&lt;/label&gt;
      &lt;div class="input-group date"&gt;
          &lt;input type="text" class="form-control pull-right" id="txtFrom"&gt;
          &lt;div class="input-group-addon"&gt;
              &lt;i class="fa fa-calendar"&gt;&lt;/i&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Script:</p>
  
  <pre><code>function MonthDatePick() {
    var month = $('#txtMonth').datepicker('getDate').getMonth() + 1;//('getMonth');            
  var year = $('#txtMonth').datepicker('getDate').getFullYear();//('getFullYear');   
  var minDate = new Date(year, month-1, 1);
   var maxDate = new Date(year,month, 0);
  $("#txtFrom").datepicker({
      autoclose: true,
      minDate: minDate,
      maxDate: maxDate,
      format: 'dd/mm/yyyy',
      //defaultDate:minDate,
      changeMonth: false,
      changeYear: false,
  });
  }
  </code></pre>
  
  <p>I debugged and found out that when I select month, min and max dates were defined. 
  For Ex: If I choose, <code>Feb 2018</code> means, </p>
  
  <pre><code>min date comes as :01/02/2018
  
  max date comes as : 28/02/2018,
  </code></pre>
  
  <p>but the change does not replicate in my date selecting date picker</p>
  
  <p>Debugging image picture</p>
  
  <p><a href="https://i.stack.imgur.com/ZgSQe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/ZgSQe.png" alt=""></a></p>
  
  <p>Debugging image picture showing min date</p>
  
  <p><a href="https://i.stack.imgur.com/MPYDA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MPYDA.png" alt=""></a></p>
  
  <p>Here is  <a href="http://jsfiddle.net/zdjwsvu5/" rel="nofollow noreferrer">my fiddle</a></p>
  
  <p>How to fix this?</p>