import { User } from './user.model'; export class Comment { constructor(public owner: User, public text: string, public pseudo: string, public created_at: string) {} public static sortChronologically(first: Comment, second: Comment): number { const a = new Date(first.created_at); const b = new Date(second.created_at); if (a < b) { return -1; } if (a > b) { return 1; } return 0; } }