Skip to main content

TimeAgoPipe

TimeAgoPipe​

Converts a date into the format "3 minutes ago", "5 hours ago" etc.

Example

{{ order.orderPlacedAt | timeAgo }}
Signature
class TimeAgoPipe implements PipeTransform {
constructor(i18nService: I18nService)
transform(value: string | Date, nowVal?: string | Date) => string;
}
  • Implements: PipeTransform

constructor​

method
(i18nService: I18nService) => TimeAgoPipe

transform​

method
(value: string | Date, nowVal?: string | Date) => string