Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,8 @@ and it's also possible to stack multiple pipes

Time ago pipe converts date to 'just now', 'X days ago', 'last week', 'X days ago', etc..

Suports `'en-US', 'pt-BR'`

**Usage:** `string | timeAgo`
```typescript
import * as moment from 'moment';
Expand All @@ -188,6 +190,12 @@ const lastWeek = moment().subtract(10, 'days');
```html
<span>Updated: {{now | timeAgo}}</span> <!-- Output: "just now" -->
<span>Updated: {{lastWeek | timeAgo}}</span> <!-- Output: "last week" -->

<span>Updated: {{now | timeAgo: 'en-US'}}</span> <!-- Output: "just now" -->
<span>Updated: {{lastWeek | timeAgo: 'en-US'}}</span> <!-- Output: "last week" -->

<span>Updated: {{now | timeAgo: 'pt-BR'}}</span> <!-- Output: "agora" -->
<span>Updated: {{lastWeek | timeAgo: 'pt-BR'}}</span> <!-- Output: "semana passada" -->
```

## String
Expand Down
Loading