mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
35 lines
955 B
Markdown
35 lines
955 B
Markdown
---
|
|
Title: Time Ago pipe
|
|
Added: v2.0.0
|
|
Status: Active
|
|
Last reviewed: 2018-11-19
|
|
---
|
|
|
|
# Time Ago Pipe
|
|
|
|
Converts a recent past date into a number of days ago.
|
|
|
|
## Basic Usage
|
|
|
|
<!-- {% raw %} -->
|
|
|
|
```HTML
|
|
<div>
|
|
Last modified: {{ date | adfTimeAgo }}
|
|
</div>
|
|
```
|
|
|
|
<!-- {% endraw %} -->
|
|
|
|
| Name | Type | Default value | Description |
|
|
|--------|--------|---------------|-------------------------------------------------|
|
|
| locale | string | 'en-US' | A locale id for the locale format rules to use. |
|
|
|
|
## Details
|
|
|
|
The pipe finds the difference between the input date and the current date. If it
|
|
is less than seven days then the date will be formatted as "X days ago".
|
|
Otherwise, the usual full date format is used.
|
|
|
|
By default, it localizes the date to the language that is currently in use by the app. Furthermore, a different locale id can be passed to the pipe to overwrite the locale id to set a custom one.
|