title: I am unable to get a month from this date format mm/yyyy using jquery
body: <p>I am unable to get a month from this date format <strong>mm/yyyy</strong> please help me how can I get a month from input bootstrap date picker thanks.</p>
  <p>I am getting a date in this formate <strong>01/2021</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>$(&quot;.monthDatePicker&quot;).datepicker({
    format: &quot;mm/yyyy&quot;,
    viewMode: &quot;months&quot;,
    minViewMode: &quot;months&quot;
  });
  
  
  // for monthly
  $('#from_date').on('change', function() {
    // var daily_monthly =&quot;{{$propertyAds-&gt;monthly_date}}&quot;
  
    var from_date = $(&quot;#from_date&quot;).val(); // 01/2021
  
    console.log(from_date)
    var d = new Date(from_date);
    var n = d.getMonth();
    console.log(n);
  });
  </code></pre>