-1

Is there any filter to show data like this:

5 minutes ago,
today,
yesterday,
01-01-2018 etc.

I researched but don't found anything like that. Laravel has a function like this is called diffForHumans()

Ramesh Rajendran
  • 37,412
  • 45
  • 153
  • 234
xamarinDev
  • 95
  • 1
  • 1
  • 11

1 Answers1

0

I would suggest Relative Time in MomentJs

moment(date).fromNow();

Relative Time

moment("20111031", "YYYYMMDD").fromNow(); // 6 years ago
moment("20120620", "YYYYMMDD").fromNow(); // 6 years ago
moment().startOf('day').fromNow();        // 19 hours ago
moment().endOf('day').fromNow();          // in 5 hours
moment().startOf('hour').fromNow();       // 15 minutes ago
Ramesh Rajendran
  • 37,412
  • 45
  • 153
  • 234