1
0
mirror of https://github.com/comatory/fb2iCal synced 2025-06-05 22:09:25 +02:00

sort table rows by createdAt record property instead of IDs

This commit is contained in:
Ondřej Synáček
2019-11-24 21:36:15 +01:00
parent 389ad386d9
commit ddbf307c29

View File

@@ -174,10 +174,12 @@
storageContents storageContents
.sort((a, b) => { .sort((a, b) => {
if (a.id < b.id) { const aDate = new Date(a.createdAt)
const bDate = new Date(b.createdAt)
if (aDate < bDate) {
return -1 return -1
} }
if (a.id > b.id) { if (aDate > bDate) {
return 1 return 1
} }
return 0 return 0