title: Angular 2 date pipe inside a FormControl input
body: <p>I have a dynamically generated Angular 2 FormGroup with multiple FormControl input fields. Some of the inputs are Dates, which are fetched from the server as unix timestamps. </p>
  
  <p>What i would like to do is :</p>
  
  <ol>
  <li>to be able to translate the unix timestamp to a human readable form,
  when my FormGroup is populated, and also </li>
  <li>translate the human
  representation of the date to a unix timestamp when the form is
  submitted.</li>
  </ol>
  
  <p>Part 1 is somewhat simple, using Angular's date pipe like this :</p>
  
  <pre><code>&lt;input class="form-control" [formControlName]="question.key"
  [value]="this.form.controls[this.question.key].value | date:'dd/MM/yyyy'"&gt;
  </code></pre>
  
  <p>Where this.form is a reference to the FormGroup and this.question is a custom wrapper class based on the official tutorial about dynamic forms :</p>
  
  <p><a href="https://angular.io/docs/ts/latest/cookbook/dynamic-form.html" rel="noreferrer">https://angular.io/docs/ts/latest/cookbook/dynamic-form.html</a></p>
  
  <p>Trying to change the date input that way won't work because the pipe will constantly try to transform the input value, thus making the input unusable if not throwing an Invalid argument for pipe 'DatePipe' exception.</p>
  
  <p>To clarify, i fill my form using the <code>FormGroup.patchValue()</code> api, and submit the form data using the <code>FormGroup.getRawValue()</code> api.</p>
  
  <p>I have tried to use an Angular 2 date picker component, but they made my huge forms pretty slow, so i would like to do it without custom date pickers or any jQuery dependent widgets.</p>
  
  <p>Thanks in advance.</p>