Closed c-crosby closed 6 years ago
+1
In my app I am replacing this: {{item.modified_at | date:'short'}}
with this:
{{item.modified_at | timeAgo}}
in about a hundred places.
If modified_at is NULL then 'NaN years ago' is displayed.
The date pipe handles this by not displaying anything and it would be great if this pipe could also just return an empty string.
From 1.3.2 It'll now return an empty string if the date is null or anything which can't be parsed as a date
let seconds = Math.round(Math.abs((now.getTime() - d.getTime()) / 1000));
If those values are the same you get a message NAN years until it updates. We're able to generate this message because of some client side updates that remove any delay that would otherwise exist between fetching data on the server and displaying it.