You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the same is true for the ParsePipe which only accepts a string format and not an array:
parse.pipe.ts
import{Pipe,PipeTransform}from'@angular/core';import*asmomentfrom'moment';// under systemjs, moment is actually exported as the default export, so we account for thatconstmomentConstructor: (value?: any)=>moment.Moment=(<any>moment).default||moment;
@Pipe({name: 'amParse'})exportclassParsePipeimplementsPipeTransform{transform(value: string,format: string): moment.Moment{returnmoment(value,format);}}
while it could be:
import{Pipe,PipeTransform}from'@angular/core';import*asmomentfrom'moment';// under systemjs, moment is actually exported as the default export, so we account for thatconstmomentConstructor: (value?: any)=>moment.Moment=(<any>moment).default||moment;
@Pipe({name: 'amParse'})exportclassParsePipeimplementsPipeTransform{transform(value: string,formats: string|string[]): moment.Moment{returnmoment(value,formats);}}
The text was updated successfully, but these errors were encountered:
Did you search for duplicate issue? [Yes]
Both implementation of pipes FromUtcPipe and ParsePipe, are not accepting format / formats as parameters, while moment instead provides the option.
from-utc.pipe.ts
could return instead
the same is true for the ParsePipe which only accepts a string format and not an array:
parse.pipe.ts
while it could be:
The text was updated successfully, but these errors were encountered: