mirror of
https://github.com/comatory/fb2iCal
synced 2025-01-30 17:04:48 +01:00
fix: sorting events by date
This commit is contained in:
parent
37d931f6ce
commit
579bde6c32
@ -27,7 +27,7 @@ const createEventStore = () => {
|
||||
startTime: startTime.toString(),
|
||||
title,
|
||||
},
|
||||
]
|
||||
].sort(sortRecord)
|
||||
}
|
||||
|
||||
state = nextState
|
||||
|
@ -15,10 +15,10 @@ export const sortRecord = (a, b) => {
|
||||
const bDate = new Date(b.createdAt)
|
||||
|
||||
if (aDate < bDate) {
|
||||
return -1
|
||||
return 1
|
||||
}
|
||||
if (aDate > bDate) {
|
||||
return 1
|
||||
return -1
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user