UNPKG

1.35 kBSource Map (JSON)View Raw
1{"version":3,"file":"date-format.pipe.js","sourceRoot":"","sources":["date-format.pipe.ts"],"names":[],"mappings":";AAAA,6DAA6D;;;;;;;;AAE7D,sCAAqE;AACrE,+BAAiC;AAEjC,4FAA4F;AAC5F,IAAM,iBAAiB,GAAyC,MAAO,CAAC,OAAO,IAAI,MAAM,CAAC;AAG1F;IAAA;IAKA,CAAC;IAJC,kCAAS,GAAT,UAAU,KAA6C;QAAE,cAAc;aAAd,UAAc,EAAd,qBAAc,EAAd,IAAc;YAAd,6BAAc;;QACrE,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;YAAC,MAAM,CAAC,EAAE,CAAC;QACtB,MAAM,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC;IAClD,CAAC;IAJU,cAAc;QAD1B,WAAI,CAAC,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;OAClB,cAAc,CAK1B;IAAD,qBAAC;CAAA,AALD,IAKC;AALY,wCAAc","sourcesContent":["/* angular2-moment (c) 2015, 2016 Uri Shaked / MIT Licence */\r\n\r\nimport {Pipe, ChangeDetectorRef, PipeTransform} from '@angular/core';\r\nimport * as moment from 'moment';\r\n\r\n// under systemjs, moment is actually exported as the default export, so we account for that\r\nconst momentConstructor: (value?: any) => moment.Moment = (<any>moment).default || moment;\r\n\r\n@Pipe({ name: 'amDateFormat' })\r\nexport class DateFormatPipe implements PipeTransform {\r\n transform(value: Date | moment.Moment | string | number, ...args: any[]): string {\r\n if (!value) return '';\r\n return momentConstructor(value).format(args[0]);\r\n }\r\n}\r\n\ninterface DecoratorInvocation {\n type: Function;\n args?: any[];\n}\n"]}
\No newline at end of file