Angular 2 “time ago” pipe

前端 未结 8 1440
余生分开走
余生分开走 2020-12-08 04:56

I am trying to create a \'time ago\' pipe for my Angular 2 application.

It should transform a date to a string such as \'5 minutes ago\' or \'60 seconds ago\'. It wo

8条回答
  •  太阳男子
    2020-12-08 05:18

    Use ngx-moment https://github.com/urish/ngx-moment, a pipe integration with Momentjs, with i18n support

提交回复
热议问题