From 7fb8d064cbf54d1216a3efc735e1e9390638b84b Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Tue, 5 Mar 2019 09:38:09 +0100 Subject: [PATCH] Fixes Issue #151 --- sonarQuest-frontend/src/app/services/user.service.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 ) })); }