Skip to content

Commit

Permalink
Fixes Issue #151
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherRBrown committed Mar 5, 2019
1 parent c7edcba commit 7fb8d06
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sonarQuest-frontend/src/app/services/user.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -53,7 +54,7 @@ export class UserService {
const url = `${environment.endpoint}/user/all`;
return this.httpClient.get <User[]>(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
)
}));
}
Expand Down

0 comments on commit 7fb8d06

Please sign in to comment.