ng2-ago
v1.0.13
Published
Angular 2 Pipe for Dates
Downloads
3
Readme
ng2-ago
ng2-ago is a Angular 2 Pipe that makes it easy to support automatically updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago").
Installation
- Install package with npm:
npm install ng2-ago --save
- Add pipe to your module:
import { TimeAgoPipe } from 'ng2-ago';
@NgModule({
...
providers: [TimeAgoPipe, ...]
...
})
Usage
Basic:
{{ yourDateElement | ago }}
Set max period time (default: 86400000ms):
{{ yourDateElement | ago:86400000 }}
Set max period time (default: 86400000ms) and date format (default: medium
):
{{ yourDateElement | ago:86400000:medium }}