title: binding a date in angularjs using webapi and the bootstrap date picker
body: <p>Given a WebApi2 service that returns json values like this:</p>
  
  <pre><code>{
      id: 1109,
      effectiveDate: "2014-10-05T00:00:00", // the date is a string (newtonsoft.json)
      text: "Duis et rhoncus nibh. Cras rhoncus cursus diam",
      fundSource: "Test"
  }
  </code></pre>
  
  <p>I need the date to appear in the bound angular / bootstrap / <strong><a href="http://eternicode.github.io/bootstrap-datepicker/?markup=input&amp;format=&amp;weekStart=&amp;startDate=&amp;endDate=&amp;startView=0&amp;minViewMode=0&amp;todayBtn=false&amp;language=en&amp;orientation=auto&amp;multidate=&amp;multidateSeparator=&amp;keyboardNavigation=on&amp;forceParse=on#sandbox">date picker</a></strong> correctly.</p>
  
  <p>I need to transform the date into the format yyyy-mm-dd (without the time) when binding it to an input box.
  Just a pointer to some documentation explaining what the correct way to serialize dates from the API to angular. I am sure that <code>effectiveDate</code> should actually be a <code>Date</code> object and not a <code>string</code>.</p>
  
  <pre><code>&lt;input class="form-control" 
         type="text" 
         name="effectiveDate" 
         ng-model="consultation.effectiveDate" 
         data-date-picker="yyyy-mm-dd" 
         placeholder="Date" /&gt;
  </code></pre>
  
  <p>For completness, the service returning the json values looks like this:</p>
  
  <pre><code>app.factory('Service', ['$http', '$location', '$interpolate', function ($http, $location, $interpolate) {
      return {
          get: function (account) {
              var url = 'api/consultations/{account}';
              return $http
                  .get(Api.format(url, { account: account }))
                  .then(function (response) { return response.data; });
          }
      };
  }]);
  </code></pre>
  
  <p>The controller method calls it like this:</p>
  
  <pre><code>service.get($scope.urlData.account).then(function(consultations) {
      $scope.consultations = consultations;
  });
  </code></pre>