File

src/app/shared/_pipes/unix-date.pipe.ts

Metadata

Name unixDate

Methods

transform
transform(timestamp: number, ...args: [])
Parameters :
Name Type Optional
timestamp number No
args [] No
Returns : any
import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'unixDate',
})
export class UnixDatePipe implements PipeTransform {
  transform(timestamp: number, ...args: unknown[]): any {
    return new Date(timestamp * 1000).toLocaleDateString('en-GB');
  }
}

result-matching ""

    No results matching ""