Skip to content
This repository was archived by the owner on Jul 8, 2021. It is now read-only.
kvcprPublic archive

About

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").

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Outdated

This package is outdated and doesn't support angular 4. I recommend to use moment.js.

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

1.1 Install package with npm:

npm install ng2-ago --save 

1.2 Install package with yarn:

yarn add ng2-ago
  1. Add pipe to your module:
import { TimeAgoPipe } from 'ng2-ago';
@NgModule({
    ...
    declarations: [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 }}

About

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").

Topics

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages