0

I have a component in which i show edited by .

<span class = "label label-success edit-btn"> Edited <time>{{today | amDifference: i.createdAt :'minutes' : false}}</time> before</span>

Prsently i am using Angular 2 Moment for the same/

But the problem is if a element has been edited like for more than 60 minutes or more than 24 hrs the info dosent change it still displays it in minutes.

I want to show like if it is less than 1 hour show in minutes like 54 minutes . if it is more than an hour display 1.04 hours and if more than 24 hour display like 1 day

Rahul
  • 427
  • 3
  • 7
  • 16
  • if you are looking for a relative time calculation this [**answer**](https://stackoverflow.com/questions/41528844/custom-pipe-filter-for-calculating-relative-time-in-angular2/41528845#41528845) might help you – Aravind Jul 07 '17 at 12:03
  • @Aravind thanks mam worked like a charm just want to know it handles epoch time right ? – Rahul Jul 07 '17 at 12:29
  • what you mean about `epoch time` ? – Aravind Jul 07 '17 at 12:50
  • The Unix epoch (or Unix time or POSIX time or Unix timestamp) is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap seconds (in ISO 8601: 1970-01-01T00:00:00Z). this is the time used to save time in firebase – Rahul Jul 07 '17 at 13:09
  • any idea about this @aravind – Rahul Jul 07 '17 at 15:23

0 Answers0