updated date pipe logic for "shophisticatedDate" branch
This commit is contained in:
parent
1f8096399a
commit
e04d8534b7
@ -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}`;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user