From c9ee9857994fc278429cf96f8bffe6c3fff1914d Mon Sep 17 00:00:00 2001 From: Hykilpikonna Date: Mon, 23 Dec 2019 10:24:09 -0500 Subject: [PATCH] [O] Sort artworks by date --- src/App.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index e851333..6194729 100644 --- a/src/App.vue +++ b/src/App.vue @@ -99,7 +99,10 @@ // Add it this.artworks.push(new Artwork(a.date, a.title, a.format)); - }) + }); + + // Sort by date + this.artworks.sort((a, b) => b.date.getTime() - a.date.getTime()); } /**