File

src/pipes/force-utc.pipe.ts

Metadata

name forceUtc

Methods

transform
transform(value: any, args?: any)
Parameters :
Name Type Optional Description
value any
args any true
Returns : any
import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'forceUtc'
})
/**
 * This pipe force a string date value to UTC
 */
export class ForceUtcPipe implements PipeTransform {

  transform(value: any, args?: any): any {
    if (value != null) {
      return value + 'Z';
    }
    return null;
  }

}

results matching ""

    No results matching ""