fix(talks): order future talks in reverse
Show the nearest upcoming talk first.
This commit is contained in:
parent
84c2c5f88d
commit
77ed75a699
|
@ -22,9 +22,16 @@ const sortedTalks = talks
|
|||
b.item.data.events[b.item.data.events.length - 1],
|
||||
];
|
||||
|
||||
return (
|
||||
new Date(events[0].date).valueOf() - new Date(events[1].date).valueOf()
|
||||
);
|
||||
const dates = [
|
||||
new Date(events[0].date).valueOf(),
|
||||
new Date(events[1].date).valueOf(),
|
||||
];
|
||||
|
||||
if (dates[0] >= today) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
return dates[0] - dates[1];
|
||||
});
|
||||
---
|
||||
|
||||
|
|
Loading…
Reference in a new issue