Sort training by date

This commit is contained in:
Tanner Collin 2020-02-04 07:17:47 +00:00
parent 54e885acb5
commit 1ebb1f64ad

View File

@ -25,7 +25,7 @@ export function Training(props) {
</Table.Header> </Table.Header>
<Table.Body> <Table.Body>
{user.training.map(x => {user.training.slice().sort((a, b) => a.session.datetime < b.session.datetime ? 1 : -1).map(x =>
<Table.Row key={x.id}> <Table.Row key={x.id}>
<Table.Cell>{x.session.course_name}</Table.Cell> <Table.Cell>{x.session.course_name}</Table.Cell>
<Table.Cell> <Table.Cell>