2020-05-05 18:17:12 +02:00
|
|
|
export class Comment {
|
2020-05-12 19:16:23 +02:00
|
|
|
constructor(public author: string, public content: string, public dateCreated: Date) {}
|
|
|
|
|
|
|
|
public static sortChronologically(a: Comment, b: Comment): number {
|
|
|
|
if (a.dateCreated < b.dateCreated) {
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
if (a.dateCreated > b.dateCreated) {
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
2020-05-05 18:17:12 +02:00
|
|
|
}
|