Skip to content
Snippets Groups Projects
Commit 6f2e2e5e authored by Lukas Mauß's avatar Lukas Mauß
Browse files

Add date to comment timestamp

parent d0c3887d
Branches
Tags
No related merge requests found
......@@ -5,10 +5,12 @@
<div fxLayout="row" class="comment-actions">
<div class="date-container">
<div class="date" *ngIf="language === 'de'; else englishDate">
{{comment.timestamp | date: ' HH:mm '}}
{{deviceType === 'desktop' ? (comment.timestamp | date: ' dd.MM.yy | HH:mm ') :
(comment.timestamp | date: ' HH:mm ')}}
</div>
<ng-template class="date" #englishDate>
{{comment.timestamp | date: 'h:mm a'}}
{{deviceType === 'desktop' ? (comment.timestamp | date: ' M/d/yy | h:mm a ') :
(comment.timestamp | date: ' h:mm a ')}}
</ng-template>
</div>
<button mat-icon-button *ngIf="comment.read" [disabled]="true" (click)="setRead(comment)">
......
......@@ -56,6 +56,7 @@ export class CommentComponent implements OnInit {
hasVoted = 0;
language: string;
animationState: string;
deviceType: string;
constructor(protected authenticationService: AuthenticationService,
private route: ActivatedRoute,
......@@ -85,6 +86,7 @@ export class CommentComponent implements OnInit {
}
this.language = localStorage.getItem('currentLang');
this.translateService.use(this.language);
this.deviceType = localStorage.getItem('deviceType');
}
startAnimation(state_: any): 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