Browse Source

Improvement date ago pipe

pull/7911/head
Vladyslav_Prykhodko 4 years ago
parent
commit
6a0e8c03a4
  1. 15
      ui-ngx/src/app/shared/pipe/date-ago.pipe.ts

15
ui-ngx/src/app/shared/pipe/date-ago.pipe.ts

@ -15,16 +15,17 @@
/// ///
import { Inject, Pipe, PipeTransform } from '@angular/core'; import { Inject, Pipe, PipeTransform } from '@angular/core';
import { DAY, HOUR, MINUTE, SECOND, WEEK, YEAR } from '@shared/models/time/time.models';
import { TranslateService } from '@ngx-translate/core'; import { TranslateService } from '@ngx-translate/core';
const intervals = { const intervals = {
years: 31536000, years: YEAR,
months: 2592000, months: DAY * 30,
weeks: 604800, weeks: WEEK,
days: 86400, days: DAY,
hr: 3600, hr: HOUR,
min: 60, min: MINUTE,
sec: 1 sec: SECOND
}; };
@Pipe({ @Pipe({

Loading…
Cancel
Save