funky-framadate-front/src/app/core/models/comment.model.ts

14 lines
312 B
TypeScript
Raw Normal View History

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
}