Skip to content
Snippets Groups Projects
Commit bada75dd authored by Sebastian Wittek's avatar Sebastian Wittek
Browse files

switch between english and german date by event

parent 1ea06816
Branches
Tags
No related merge requests found
......@@ -26,9 +26,14 @@
</div>
</div>
<div id="footer">
<div id="date">
{{comment.timestamp}}
<div *ngIf="lang === 'de'; else englishDate">
{{comment.timestamp | date: ' HH:mm:ss '}}Uhr,{{comment.timestamp | date: ' M.d.yy'}}
</div>
<ng-template #englishDate>
{{comment.timestamp | date: 'h:mm:ss a, M/d/yy'}}
</ng-template>
<div id="counter">
</div>
</div>
......
......@@ -21,6 +21,7 @@ export class CommentComponent implements OnInit {
isStudent = false;
isLoading = true;
hasVoted = 0;
lang: string;
constructor(protected authenticationService: AuthenticationService,
private route: ActivatedRoute,
......@@ -31,13 +32,18 @@ export class CommentComponent implements OnInit {
public dialog: MatDialog,
protected langService: LanguageService,
private wsCommentService: WsCommentServiceService) {
langService.langEmitter.subscribe(lang => translateService.use(lang)); }
langService.langEmitter.subscribe(lang => {
translateService.use(lang);
this.lang = lang;
} );
}
ngOnInit() {
if (this.authenticationService.getRole() === 0) {
this.isStudent = true;
}
this.translateService.use(localStorage.getItem('currentLang'));
this.lang = localStorage.getItem('currentLang');
this.translateService.use(this.lang);
}
setRead(comment: Comment): void {
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment