[web] Fix error in GroupedList provoked by the linting

This commit is contained in:
Alain Nussbaumer 2024-04-21 20:09:00 +02:00
parent 06f658e1c4
commit 1ef62ac3a6
1 changed files with 2 additions and 3 deletions

View File

@ -8,7 +8,7 @@ const stringComparator = (a, b) => a.localeCompare(b, locale.value)
const dateComparator = (a, b) =>
new Date(a) - new Date(b) || (!a ? -1 : !b ? 1 : 0)
const createComparators = (criteria) => {
const createComparators = (criteria) =>
criteria.map(({ field, type, order = 1 }) => {
switch (type) {
case String:
@ -18,10 +18,9 @@ const createComparators = (criteria) => {
case Date:
return (a, b) => dateComparator(a[field], b[field]) * order
default:
return null
return (a, b) => 0
}
})
}
const characterIndex = (string = '') => {
const value = string.charAt(0)