Added sorting to the posts (order by date, descending)
This commit is contained in:
parent
e22d189e52
commit
dc0c1cf440
@ -89,6 +89,9 @@ export class PostsComponent implements OnInit, OnDestroy {
|
|||||||
// console.log('we should not display this');
|
// console.log('we should not display this');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// sort the posts
|
||||||
|
res.sort((p1, p2) => p2.created_timestamp.getMilliseconds() - p1.created_timestamp.getMilliseconds());
|
||||||
|
|
||||||
this.filteredPosts = res;
|
this.filteredPosts = res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user