artist feed will now sort by date correctly, removed some console alerts

This commit is contained in:
booploops 2021-12-29 05:53:14 -08:00
parent 7a19de11f7
commit 0da3ad6b1d
2 changed files with 13 additions and 7 deletions

View file

@ -54,6 +54,12 @@
self.artistFeed.push(item.views["latest-release"].data[0])
}
})
// sort artistFeed by attributes.releaseDate descending, date is formatted as "YYYY-MM-DD"
this.artistFeed.sort((a, b) => {
let dateA = new Date(a.attributes.releaseDate)
let dateB = new Date(b.attributes.releaseDate)
return dateB - dateA
})
})
}