member_webapp/@overflow/shared/ui/pipe/uptime.pipe.ts
crusader b525f40063 ing
2018-05-31 17:27:00 +09:00

15 lines
474 B
TypeScript

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);
}
}