urish / angular-moment

Moment.JS directives for Angular.JS (timeago and more)
MIT License
2.6k stars 397 forks source link

What's the time-ago filter? #192

Closed mirague closed 8 years ago

mirague commented 8 years ago

I want to display the time ago (e.g. "a few seconds ago") in a tooltip when an icon is hovered, like so:

<span class="time">
    <i class="icon-star" tooltips tooltip-title="You added this {{ favourite.favourited_at | amUtc | amLocal | amDateFormat:'YYYY-MM-DD HH:mm:ss' }}"></i>
</span>

How can I do this? I can't find anything like this in the docs.

urish commented 8 years ago

We do have an amTimeAgo filter. It is not documented (as it should be), but you can still use it.

https://github.com/urish/angular-moment/blob/9680d6f1d21585e40f32e1de8f002e64daf20906/angular-moment.js#L589

mirague commented 8 years ago

I found it shortly after opening this issue, thanks for your time and apologies for not looking more thorough before posting!