Update sorting

This commit is contained in:
tree 2023-02-13 12:56:43 +01:00
parent 697c94f868
commit 4d05afe592
2 changed files with 8 additions and 2 deletions

View File

@ -73,7 +73,7 @@
class="grid grid-cols-3 sm:grid-cols-3 md:grid-cols-6 xl:grid-cols-8 my-6 text-center text-xl"
>
<CollectionList
arr={data.bundle.speakers.filter((s) => !['cz', 'sk'].includes(s.country))}
arr={data.bundle.speakers.filter((s) => !['cz', 'sk'].includes(s.country)).sort((x, y) => (x.name > y.name ? 1 : -1))}
{entry}
offer="true"
/>
@ -85,7 +85,7 @@
class="grid grid-cols-3 sm:grid-cols-3 md:grid-cols-6 xl:grid-cols-8 my-6 text-center text-xl"
>
<CollectionList
arr={data.bundle.speakers.filter((s) => ['cz', 'sk'].includes(s.country))}
arr={data.bundle.speakers.filter((s) => ['cz', 'sk'].includes(s.country)).sort((x, y) => (x.name > y.name ? 1 : -1))}
{entry}
offer="true"
/>

View File

@ -43,6 +43,12 @@
// return compareAsc(item.new Date(query.segment) > 0)
});
}
if (['speakers', 'benefits', 'media-partner'].includes(type)) {
_items = _items.sort((x, y) => (x.name > y.name ? 1 : -1))
}
if (type === 'places') {
_items = _items.sort((x, y) => (x.capacity > y.capacity ? -1 : 1))
}
return _items;
}