title: JQuery date picker substring to get month in particular format
body: <p>I'm implementing a date picker. I want the date to be the following format</p>
  
  <p><code>MM-DD-YY</code> using <code>myDate.getFullYear().substring(0,2)</code></p>
  
  <p>How come substring is not working here?</p>
  
  <pre><code> $(function() {
              $( "#datepicker" ).datepicker();
              var myDate = new Date();
              var prettyDate =(myDate.getMonth()+1) + '-' + myDate.getDate() + '-' + myDate.getFullYear().substring(0,2);
              $("#datepicker").val(prettyDate);
            });
  </code></pre>