You get this error if the value doesn't pass this check
https://github.com/angular/angular/blob/5ba9ced1ab6540d9ad2e25f158355633a65adc4f/modules/angular2/src/common/pipes/date_pipe.ts#L121
supports(obj: any): boolean { return isDate(obj) || isNumber(obj); }
isDate from
https://github.com/angular/angular/blob/7ae23adaff2990cf6022af9792c449730d451d1d/modules/angular2/src/facade/lang.ts#L126
export function isDate(obj): boolean { return obj instanceof Date &&
!isNaN(obj.valueOf());}
so, the value has to be either of type `Date` or `number`
This might work (not tried)
{{new Date(app.LastUpdated)|date}}
On Thursday, January 21, 2016 at 11:13:13 AM UTC+1, levyuk wrote:
>
> Anyone know why when I try to format a date with the date pipe I get the
> following error?
>
> Invalid argument '2016-01-19T10:10:49.892688Z' for pipe 'DatePipe' in [
> {{app.LastUpdated|date}}
>
>
> Thanks
> Jon
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.