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