sort table rows by createdAt record property instead of IDs
This commit is contained in:
parent
389ad386d9
commit
ddbf307c29
|
@ -174,10 +174,12 @@
|
|||
|
||||
storageContents
|
||||
.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
|
||||
}
|
||||
if (a.id > b.id) {
|
||||
if (aDate > bDate) {
|
||||
return 1
|
||||
}
|
||||
return 0
|
||||
|
|
Loading…
Reference in New Issue