diff --git a/apps/red-ui/src/app/modules/shared/pipes/date.pipe.ts b/apps/red-ui/src/app/modules/shared/pipes/date.pipe.ts index d4017a2f1..b2a1364ee 100644 --- a/apps/red-ui/src/app/modules/shared/pipes/date.pipe.ts +++ b/apps/red-ui/src/app/modules/shared/pipes/date.pipe.ts @@ -90,13 +90,15 @@ export class DatePipe extends BaseDatePipe implements PipeTransform { return this._translateService.instant('yesterday'); } - const isShortMonthFormat = day < thisDay - 1 && (year === thisYear || month >= thisMonth - 3); + const isShortMonthFormat = + year === thisYear && + ((month === thisMonth && day !== thisDay && day !== thisDay - 1) || (month !== thisMonth && month >= thisMonth - 2)); if (isShortMonthFormat) { const translatedMonth = this._translateService.instant(MONTH_NAMES[month]); return `${day} ${translatedMonth}`; } - const isShortMonthYearFormat = year === thisYear - 1 && month < thisMonth - 3; + const isShortMonthYearFormat = (year === thisYear && month <= thisMonth - 3) || year === thisYear - 1; if (isShortMonthYearFormat) { const translatedMonth = this._translateService.instant(MONTH_NAMES[month]); return `${translatedMonth} ${year}`;