title: Why datepicker calendar will not giving the assigned value?
body: <p>Here in the html I'm assigning the date to the text field but the calendar of the datepicker will not pick that assigned value it will show always me the current date.</p>
  
  <p>Assigning the value to the text field Using jQuery:-</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> $('#datepicker').val("06-10-2018");
   
   
   $( function() {
      $( "#datepicker" ).datepicker({
        numberOfMonths: 2,
           onSelect: function(selected) {
              $("#txtFromDate").datepicker("option","maxDate", selected)
           }
      });
    } );</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;link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"&gt;
    &lt;link rel="stylesheet" href="/resources/demos/style.css"&gt;
    &lt;script src="https://code.jquery.com/jquery-1.12.4.js"&gt;&lt;/script&gt;
    &lt;script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"&gt;&lt;/script&gt;
  &lt;p&gt;Date: &lt;input type="text" id="datepicker"&gt;&lt;/p&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>How will change the current value of calendar according the assigning of the value to the text field. Can anybody will help me for this. Thank you.</p>