Aditya
Aditya

Reputation: 2536

How to display the time as 1 mins ago using angular2-moment

<div>{{2018-04-16T05:56:45.200Z | amTimeAgo}}</div>

The above gives me results after a minute as 1 minutes ago but I want the result as 1 mins ago How can I achieve this using angular2-moment npm module?

I have to use this module only to fulfill the result.The link is providedhere

Upvotes: 0

Views: 63

Answers (1)

Oliver
Oliver

Reputation: 45101

After reading the code of the pipe you can see that it calls the moment constructor and the from() method like it is described in the moment documentation.

After digging a little further about how to set the used strings I found this configuration object in the documentation. And with this knowledge I tried to find something setting this property bringing me to this open issue. So there seems to be in interims solution which you can (maybe) use. There was also already a try to solve this problem.

But it seems to need some kind of polishing (move positional parameters to object properties). Maybe you can take the job and improve the code?

Upvotes: 1

Related Questions