title: Transforming date format using pipe into specific model with three options
body: <p>I'm looking for a solution to change the format of the displayed date on the forum. I would like to display the date of the last post written in the specific thread, and if the post was written today or yesterday I would like it to show &quot;Today at 12:33&quot; or &quot;Yeasterday at 13:22&quot; in any other case I would like to display only the date format: &quot;dd-MM-yyyy &quot;
  Currently my solution is as follows:</p>
  <pre><code>&lt;div class=&quot;date-format&quot;&gt;{{thread.createdAt | date:'dd-MM-yy' }}&lt;/div&gt;
  </code></pre>
  <p>And here is the format of the date i get:</p>
  <pre><code>&quot;createdAt&quot;: &quot;2021-12-08T13:41:53.314223Z&quot;,
  </code></pre>
  <p>I'd like to use angular pipes, but I don't really know how to include it in this file:</p>
  <pre><code>import { Pipe, PipeTransform } from '@angular/core';
  @Pipe({
    name: 'dateTime'
  })
  export class DateTimePipe implements PipeTransform {
  
    transform(value: unknown, ...args: unknown[]): unknown {
      return null;
    }
  
  }
  </code></pre>