diff --git a/sonarQuest-frontend/src/app/services/user.service.ts b/sonarQuest-frontend/src/app/services/user.service.ts index b0951dca..0fee8aa7 100644 --- a/sonarQuest-frontend/src/app/services/user.service.ts +++ b/sonarQuest-frontend/src/app/services/user.service.ts @@ -4,7 +4,8 @@ import {HttpClient} from '@angular/common/http'; import {environment} from '../../environments/environment'; import {Observable, Subscriber} from 'rxjs'; import {AuthenticationService} from '../login/authentication.service'; -import {map, tap} from 'rxjs/operators'; +import {tap} from 'rxjs/operators'; +import * as moment from 'moment'; @Injectable() export class UserService { @@ -53,7 +54,7 @@ export class UserService { const url = `${environment.endpoint}/user/all`; return this.httpClient.get (url).pipe(tap((users: User[]) => { users.forEach(user => - user.lastLogin = user.lastLogin ? new Date(user.lastLogin).toTimeString() : null + user.lastLogin = user.lastLogin ? moment(new Date(user.lastLogin)).format('DD.MM.YYYY HH:mm:ss') : null ) })); }