mirror of https://github.com/Ombi-app/Ombi
parent
06587d9345
commit
a3688b6ad7
@ -0,0 +1,17 @@
|
|||||||
|
import { Pipe, PipeTransform } from "@angular/core";
|
||||||
|
import { FormatPipe } from 'ngx-date-fns';
|
||||||
|
|
||||||
|
@Pipe({
|
||||||
|
name: "ombiDate",
|
||||||
|
})
|
||||||
|
export class OmbiDatePipe implements PipeTransform {
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private FormatPipe: FormatPipe,
|
||||||
|
) {}
|
||||||
|
|
||||||
|
public transform(value: string, format: string ) {
|
||||||
|
const date = new Date(value);
|
||||||
|
return this.FormatPipe.transform(date, format);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in new issue