mirror of
https://github.com/fergalmoran/icebreaker-mobile.git
synced 2026-01-03 23:45:34 +00:00
18 lines
473 B
TypeScript
18 lines
473 B
TypeScript
|
|
import {Pipe} from '@angular/core';
|
|
import * as moment from 'moment';
|
|
|
|
// Tell Angular2 we're creating a Pipe with TypeScript decorators
|
|
@Pipe({
|
|
name: 'MomentDate'
|
|
})
|
|
export class MomentDate {
|
|
|
|
// Transform is the new "return function(value, args)" in Angular 1.x
|
|
transform(value, args?) {
|
|
// see http://momentjs.com/docs/#/displaying/ for information
|
|
// on formatting the date using moment
|
|
return moment(value).format(args[0])
|
|
}
|
|
|
|
} |