diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-experiments/dot-experiments-list/components/dot-experiments-list-table/dot-experiments-list-table.component.html b/core-web/apps/dotcms-ui/src/app/portlets/dot-experiments/dot-experiments-list/components/dot-experiments-list-table/dot-experiments-list-table.component.html index 3890f846bdb7..8264b800d721 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-experiments/dot-experiments-list/components/dot-experiments-list-table/dot-experiments-list-table.component.html +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-experiments/dot-experiments-list/components/dot-experiments-list-table/dot-experiments-list-table.component.html @@ -27,10 +27,10 @@ {{ experiment.name }} - {{ experiment.creationDate | date : 'longDate' }} + {{ experiment.creationDate | dotRelativeDate : true }} - {{ experiment.modDate | date : 'longDate' }} + {{ experiment.modDate | dotRelativeDate : true }} { ConfirmPopupModule, ToastModule, DotMessagePipeModule, - RouterTestingModule + RouterTestingModule, + DotRelativeDatePipe ], component: DotExperimentsListTableComponent, componentMocks: [ConfirmPopup], @@ -79,7 +82,8 @@ describe('DotExperimentsListTableComponent', () => { useValue: messageServiceMock }, MessageService, - ConfirmationService + ConfirmationService, + { provide: DotFormatDateService, useClass: DotFormatDateServiceMock } ] }); @@ -127,11 +131,9 @@ describe('DotExperimentsListTableComponent', () => { groupedExperimentByStatus.DRAFT[0].name ); expect(spectator.query(byTestId('experiment-row__createdDate'))).toHaveText( - groupedExperimentByStatus.DRAFT[0].creationDate.toLocaleDateString() - ); - expect(spectator.query(byTestId('experiment-row__modDate'))).toHaveText( - groupedExperimentByStatus.DRAFT[0].modDate.toLocaleDateString() + '1 hour ago' ); + expect(spectator.query(byTestId('experiment-row__modDate'))).toHaveText('1 hour ago'); }); describe('Actions icons', () => { diff --git a/core-web/apps/dotcms-ui/src/app/portlets/dot-experiments/dot-experiments-list/dot-experiments-list.module.ts b/core-web/apps/dotcms-ui/src/app/portlets/dot-experiments/dot-experiments-list/dot-experiments-list.module.ts index eaa906ef1618..26171cea86de 100644 --- a/core-web/apps/dotcms-ui/src/app/portlets/dot-experiments/dot-experiments-list/dot-experiments-list.module.ts +++ b/core-web/apps/dotcms-ui/src/app/portlets/dot-experiments/dot-experiments-list/dot-experiments-list.module.ts @@ -16,6 +16,7 @@ import { UiDotIconButtonModule } from '@components/_common/dot-icon-button/dot-i import { UiDotIconButtonTooltipModule } from '@components/_common/dot-icon-button-tooltip/dot-icon-button-tooltip.module'; import { DotIconModule } from '@dotcms/ui'; import { DotMessagePipeModule } from '@pipes/dot-message/dot-message-pipe.module'; +import { DotRelativeDatePipe } from '@pipes/dot-relative-date/dot-relative-date.pipe'; import { DotExperimentsListRoutingModule } from '@portlets/dot-experiments/dot-experiments-list/dot-experiments-list-routing.module'; import { DotExperimentsService } from '@portlets/dot-experiments/shared/services/dot-experiments.service'; import { DotExperimentsUiHeaderComponent } from '@portlets/dot-experiments/shared/ui/dot-experiments-header/dot-experiments-ui-header.component'; @@ -58,7 +59,8 @@ import { DotExperimentsListComponent } from './dot-experiments-list.component'; MenuModule, ConfirmDialogModule, ConfirmPopupModule, - ToastModule + ToastModule, + DotRelativeDatePipe ], providers: [DotExperimentsService] })