From 6d27fd0f8cd44ffc1e216b94680bde3a83511995 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 25 Jan 2018 02:45:00 +0100 Subject: sort --- public/assets/js/lib/views/details/comments.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/public/assets/js/lib/views/details/comments.js b/public/assets/js/lib/views/details/comments.js index 967204e..085873e 100644 --- a/public/assets/js/lib/views/details/comments.js +++ b/public/assets/js/lib/views/details/comments.js @@ -22,7 +22,9 @@ var CommentsView = FormView.extend({ this.$el.prepend(this.$formRow) } else { - comments.forEach(this.appendComment.bind(this)) + comments + .sort((a,b) => cmp(a.date, b.date)) + .forEach(this.appendComment.bind(this)) } }, -- cgit v1.2.3-70-g09d2