AngularJS TimeSince Filter

An AngularJS filter for displaying time in facebook format: "6 minutes ago", "2 days ago", "1 week ago"

Download source - Demo page

Example

Filtered text / Result

01/03/2015 is time ago


Usage

  1. Include "timesince.filter.js" in the html head
  2. Change the app module name in the filter to your app name (default name is set to 'app')
  3. Use the filter
<html ng-app="app"> 
<head>
    ...template, angular stuff, etc...

    <!-- include the filter -->
    <script src="timesince.filter.js"></script> 

    ....
</head>
<body>
    <div ng-controller="main">
        ...
        <span ng-bind="date | timesince"> long long time ago</span>
        ...        
    </div>
</body>

</html>