member_webapp/@overflow/shared/ui/pipe/uptime.pipe.ts

15 lines
474 B
TypeScript
Raw Normal View History

2018-05-31 08:27:00 +00:00
import { Pipe, PipeTransform } from '@angular/core';
import { DatePipe } from '@angular/common';
@Pipe({
name: 'ofUPTime'
})
export class UPTimePipe extends DatePipe implements PipeTransform {
transform(value: any, nullString: string, format = 'mediumDate', timezone?: string, locale?: string): string | null {
if (value == null || value === '' || value !== value) {
return nullString;
}
return super.transform(value, format, timezone, locale);
}
}