title: How to convert date from European format
body: <p><strong>THE SITUATION</strong>:</p>
  
  <p>From the API i get the dates in the european format: <code>01-06-2018</code> <br>  That is: day - month - year (1 june 2018).</p>
  
  <p>I need to display in a more beautiful way - the <a href="https://angular.io/docs/ts/latest/api/common/index/DatePipe-pipe.html" rel="nofollow noreferrer">'d MMM y'</a> format is exactly what I need.</p>
  
  <p>But if i use the pipeline in the view in this way:</p>
  
  <pre><code>{{ projectInfo.project_start_date | date: 'd MMM y' }}
  </code></pre>
  
  <p>The result is: <code>6 Jan 2018</code> (while in my case should be <code>1 Jun 2018</code>)</p>
  
  <p>Because it thinks that the first two cyphers of my date <code>01-06-2018</code> are the month - while they are days..</p>
  
  <p><strong>THE QUESTION</strong>:</p>
  
  <p>How can convert European formatted dates in Angular 2?</p>
  
  <p>Should I convert them in the component from European format to American format?</p>
  
  <p>If yes - do you know how that can be done in Angular 2?</p>
  
  <p>Thanks!</p>
  
  <p><strong>EDIT</strong>: </p>
  
  <p>This how I have tried to convert the string i received from the API into an actual date:</p>
  
  <p>In the component:</p>
  
  <pre><code>dateTest: Date;
  this.dateTest = new Date(this.projectInfo['project_start_date']);
  </code></pre>
  
  <p>In the view:</p>
  
  <pre><code>&lt;span&gt; {{ dateTest | date: 'd MMM y' }} &lt;/span&gt;
  </code></pre>
  
  <p>The result:</p>
  
  <p>Still the same: 6 Jan 2018</p>
  
  <p><strong>PLUNKER</strong>:</p>
  
  <p><a href="https://plnkr.co/edit/ZYMoaoxawVCtScUZfL3B?p=preview" rel="nofollow noreferrer">https://plnkr.co/edit/ZYMoaoxawVCtScUZfL3B?p=preview</a></p>