title: Sort by date Angular 2 pipe
body: <p>Here is my code: </p>
  
  <pre><code>&lt;div *ngFor="let conv of lender.conversation | orderBy" class="conv-single"&gt;
     {{conv.date | date: 'dd/MM/yyyy | j'}} - {{conv.text}}
  &lt;/div&gt;
  </code></pre>
  
  <p>I have object like this:</p>
  
  <pre><code>[{
  date: somedate,
  text: "text1" 
  }
  ...]
  </code></pre>
  
  <p>And here is my orderBy pipe:</p>
  
  <pre><code>@Pipe({
      name: 'orderBy'
  })
  export class OrderByPipe implements PipeTransform {
  
      transform(value: any, args?: any): any {
          let newVal = value.sort((a: any, b: any) =&gt; {
              let date1 = new Date(a.date);
              let date2 = new Date(b.date);
  
              if (date1 &gt; date2) {
                  return 1;
              } else if (date1 &lt; date2) {
                  return -1;
              } else {
                  return 0;
              }
          });
  
          return newVal;
      }
  
  }
  </code></pre>
  
  <p>Problem is I always get elements in same order anyone know what is problem?</p>