title: How do I use a date filter in ng-model?
body: <p>This seems like it should be simple but it has eluded me. I would like to convert my date string to a date object and filter how it is displayed.</p>
  
  <p>I have a simple angular app and controller</p>
  
  <pre><code>myApp.controller('myAppCtrl', function($scope) {
     $scope.MyDate = Date("2014-09-23T15:26:49.1513672Z");
  })
  </code></pre>
  
  <p>I have JSON returned from the server and the date I am working with is a string in the above format</p>
  
  <p>from the angular documentation about <a href="https://docs.angularjs.org/api/ng/filter/date">date filters</a></p>
  
  <pre><code>  &lt;span&gt;{{1288323623006 | date:'medium'}}&lt;/span&gt;&lt;br&gt;
  </code></pre>
  
  <p>this works and the out put is:
  Oct 28, 2010 8:40:23 PM</p>
  
  <p>When I try to use the filter on $scope.MyDate as follows:</p>
  
  <pre><code>  {{MyDate | date:'medium'}}
  </code></pre>
  
  <p>the date is not formatted but looks like this:
  Wed Sep 24 2014 07:40:02 GMT-0700 (Pacific Daylight Time)</p>
  
  <p>Ultimately I would like to bind an input text box to this value and filter it like this:</p>
  
  <pre><code>&lt;input type="text" class="form-control" ng-model="MyDatee | date:'medium'"/&gt;
  </code></pre>
  
  <p>I am hoping once i get the simple version working I can get my actual problem solved with the text input. </p>
  
  <p>Here is a <a href="http://plnkr.co/edit/ActFrWBaK0LR6AK10qtR">plunker with the above code</a></p>