title: Angular UI datepicker - date format from API
body: <p>I'm using the Angular UI datepicker component. When my data comes down from the API, I get dates in this format in the JSON:</p>
  
  <pre><code>"date": "2015-10-21T00:00:00"
  </code></pre>
  
  <p>The datepicker is correctly formatting the date in the input field to "21 October 2015". But, if I click the submit button on the form, without making any changes, the date field fails validation. </p>
  
  <p>If I set the date model to a date object (as opposed to a string) like so, after the JSON loads:</p>
  
  <pre><code>vm.date = new Date();
  </code></pre>
  
  <p>Then the validation works. </p>
  
  <p>So it seems the datepicker component doesn't set the date correctly, when using a string value as the model.</p>
  
  <p>Any way to fix this?</p>
  
  <p>Here is a link to a plunkr:
  <a href="http://plnkr.co/edit/gAhme7fmIPgbojYVJlNU?p=preview" rel="nofollow">http://plnkr.co/edit/gAhme7fmIPgbojYVJlNU?p=preview</a></p>
  
  <p>If you choose a date using the datepicker calender, it works fine. But if the date gets set using the button, as it would using JSON API data, then it fails validation.</p>