diff --git a/src/app/components/shared/comment/comment.component.html b/src/app/components/shared/comment/comment.component.html index 17c8eeedf47057d28a14bd633d1b0298b257ef3f..af0ab6000fda306190d7254b9f63143534399a6c 100644 --- a/src/app/components/shared/comment/comment.component.html +++ b/src/app/components/shared/comment/comment.component.html @@ -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)"> diff --git a/src/app/components/shared/comment/comment.component.ts b/src/app/components/shared/comment/comment.component.ts index 33510bff385f54f29f9b143d06a9d1d5324f41c2..ac7502a6c10634e70620d0d0a6dacad383b7300f 100644 --- a/src/app/components/shared/comment/comment.component.ts +++ b/src/app/components/shared/comment/comment.component.ts @@ -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 {