From cd33d8d7a946a2a291468567eac33ce4ecb923ee Mon Sep 17 00:00:00 2001 From: s416122 Date: Mon, 13 Jan 2020 14:44:14 +0100 Subject: [PATCH] =?UTF-8?q?Wy=C5=9Bwietlanie=20daty=20i=20godziny=20rozpoc?= =?UTF-8?q?z=C4=99cia=20testu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../group-details/group-details.component.ts | 22 +++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/FrontEnd/src/app/groups/group-details/group-details.component.ts b/FrontEnd/src/app/groups/group-details/group-details.component.ts index f845b5a..2dd96c6 100644 --- a/FrontEnd/src/app/groups/group-details/group-details.component.ts +++ b/FrontEnd/src/app/groups/group-details/group-details.component.ts @@ -39,7 +39,7 @@ export class GroupDetailsComponent implements OnInit, OnDestroy { { headerName: 'Nazwa', field: 'title', headerTooltip: 'Nazwa' }, { headerName: 'Ocena', field: 'grade', headerTooltip: 'Ocena' }, { headerName: 'Max.', field: 'maxScore', headerTooltip: 'Max.', hide: false }, - { headerName: 'Rozpoczęcie testu', field: 'dateFrom', headerTooltip: 'Rozpoczęcie testu' }, + { headerName: 'Rozpoczęcie testu', field: 'startDate', headerTooltip: 'Rozpoczęcie testu' }, { headerName: '', suppressMenu: true, @@ -207,7 +207,7 @@ export class GroupDetailsComponent implements OnInit, OnDestroy { { headerName: 'Nazwa', field: 'title', headerTooltip: 'Nazwa' }, { headerName: 'Ocena', field: 'grade', headerTooltip: 'Ocena' }, { headerName: 'Max.', field: 'maxScore', headerTooltip: 'Max.', hide: true }, - { headerName: 'Rozpoczęcie testu', field: 'dateFrom', headerTooltip: 'Rozpoczęcie testu'}, + { headerName: 'Rozpoczęcie testu', field: 'startDate', headerTooltip: 'Rozpoczęcie testu'}, { headerName: '', suppressMenu: true, @@ -220,7 +220,7 @@ export class GroupDetailsComponent implements OnInit, OnDestroy { { headerName: 'Nazwa', field: 'title', headerTooltip: 'Nazwa' }, { headerName: 'Ocena', field: 'grade', headerTooltip: 'Ocena' }, { headerName: 'Max.', field: 'maxScore', headerTooltip: 'Max.' }, - { headerName: 'Rozpoczęcie testu', field: 'dateFrom', headerTooltip: 'Rozpoczęcie testu'}, + { headerName: 'Rozpoczęcie testu', field: 'startDate', headerTooltip: 'Rozpoczęcie testu'}, { headerName: '', suppressMenu: true, @@ -279,7 +279,21 @@ export class GroupDetailsComponent implements OnInit, OnDestroy { if (resource === 'testów') { this.localeText.noRowsToShow = 'Brak testów do wyświetlenia'; setTimeout(() => { - this.testsSubscription = this.groupService.getResource(this.id, 'tests').subscribe(data => this.data = data); + this.testsSubscription = this.groupService.getResource(this.id, 'tests').subscribe(data => { + this.data = data; + data.forEach(x => { + const temp = new Date(x['dateFrom']); + x['startDate'] = ''; + const hours = temp.getHours(); + const minutes = temp.getMinutes(); + const months = ['STY', 'LUT', 'MAR', 'KWI', 'MAJ', 'CZE', 'LIP', 'SIE', 'WRZ', 'PAŹ', 'LIS', 'GRU']; + const year = temp.getFullYear(); + const month = months[temp.getMonth()]; + const date = temp.getDate(); + const time = date + ' ' + month + ' ' + year + ' ' + hours + ':' + minutes; + x['startDate'] += time; + }); + }); this.dataToDisplay = resource; }, 200);