diff --git a/src/app/components/shared/comment-list/comment-list.component.ts b/src/app/components/shared/comment-list/comment-list.component.ts index 8e097e465fe86e4e9348718d34244c046130cb6c..a734f405e94ea31508cc8ef07bf4b03d92a0bdb7 100644 --- a/src/app/components/shared/comment-list/comment-list.component.ts +++ b/src/app/components/shared/comment-list/comment-list.component.ts @@ -69,7 +69,6 @@ export class CommentListComponent implements OnInit { c.roomId = this.roomId; c.body = payload.body; c.id = payload.id; - c.creationTimestamp = payload.timestamp; this.comments = this.comments.concat(c); break; case 'CommentPatched': diff --git a/src/app/components/shared/comment/comment.component.html b/src/app/components/shared/comment/comment.component.html index d1363c0363e71a1e831fa1e5f5227372e785cf82..1f831bacaecb5e7e9289f03c4bc754cbedea4195 100644 --- a/src/app/components/shared/comment/comment.component.html +++ b/src/app/components/shared/comment/comment.component.html @@ -25,5 +25,12 @@ </button> </div> </div> + <div id="footer"> + <div id="date"> + {{comment.timestamp}} + </div> + <div id="counter"> + </div> + </div> </div> </mat-card> diff --git a/src/app/components/shared/comment/comment.component.scss b/src/app/components/shared/comment/comment.component.scss index 3174c0b7241f75a911043e5d0e16d72e25b3e821..f28d12f68a6f20b149b9532323ab8d30c18bebce 100644 --- a/src/app/components/shared/comment/comment.component.scss +++ b/src/app/components/shared/comment/comment.component.scss @@ -76,3 +76,9 @@ h2 { overflow: hidden; text-overflow: ellipsis; } + +.date { + position: fixed; + bottom: 0; + left: 0; +} diff --git a/src/app/models/comment.ts b/src/app/models/comment.ts index 2fb2ad760db8e8cb2c39c6b389fb34f52f1fe474..df7165a4bd6c24397b611f3b3871e6fd3296e656 100644 --- a/src/app/models/comment.ts +++ b/src/app/models/comment.ts @@ -7,7 +7,7 @@ export class Comment { read: boolean; correct: boolean; favorite: boolean; - creationTimestamp: Date; + timestamp: Date; score: number; createdFromLecturer: boolean; @@ -28,7 +28,7 @@ export class Comment { this.read = read; this.correct = correct; this.favorite = favorite; - this.creationTimestamp = creationTimestamp; + this.timestamp = creationTimestamp; this.score = score; this.createdFromLecturer = createdFromLecturer; } diff --git a/src/app/services/http/comment.service.ts b/src/app/services/http/comment.service.ts index d8673aa279dd3247b6afc5c2c36c2057201a47df..c3179ad69aad8f1c8811b5bdd8254d3294e47f31 100644 --- a/src/app/services/http/comment.service.ts +++ b/src/app/services/http/comment.service.ts @@ -33,7 +33,7 @@ export class CommentService extends BaseHttpService { const connectionUrl = this.apiUrl.base + this.apiUrl.comment + '/'; return this.http.post<Comment>(connectionUrl, { roomId: comment.roomId, body: comment.body, - read: comment.read, creationTimestamp: comment.creationTimestamp + read: comment.read, creationTimestamp: comment.timestamp }, httpOptions).pipe( tap(_ => ''), catchError(this.handleError<Comment>('addComment'))