title: How to set the initial date of a jquery datepicker from php
body: <p>In my php file I have:</p>
  
  <pre><code>$startDate = new DateTime('2013-08-15');
  $endDate = new DateTime('2013-10-15');
  echo '&lt;div id="filterStartDate"&gt;Start Date:&lt;/div&gt;';
  echo '&lt;div id="filterEndDate"&gt;End Date:&lt;/div&gt;';
  </code></pre>
  
  <p>Then in the javascript I have:</p>
  
  <pre><code>$('#filterStartDate').datepicker({
      changeMonth:true,
      changeYear:true,
      dateFormat:'yy-mm-dd',
      onSelect: function( selectedDate ) {
          $( "#filterEndDate" ).datepicker( "option", "minDate", selectedDate );
      }
  });
  $('#filterEndDate').datepicker({
      changeMonth: true,
      changeYear: true,
      dateFormat:'yy-mm-dd',
      onSelect: function( selectedDate ) {
          $( "#filterStartDate" ).datepicker( "option", "maxDate", selectedDate );
          alert($("#filterEndDate").val());
      }
  });
  </code></pre>
  
  <p>I would like to know if there is a way to set the initial date on the datePicker from PHP.  I know I could generate the javascript from within php, but I think that is messy and would like to keep the separation.  It would be awesome if there were something like:</p>
  
  <pre><code>echo '&lt;div id="filterStartDate" value="'.$startDate-&gt;format('Y-m-d').'"&gt;Start Date:&lt;/div&gt;';
  </code></pre>