[web] Fix error in GroupedList provoked by the linting
This commit is contained in:
parent
06f658e1c4
commit
1ef62ac3a6
|
@ -8,7 +8,7 @@ const stringComparator = (a, b) => a.localeCompare(b, locale.value)
|
||||||
const dateComparator = (a, b) =>
|
const dateComparator = (a, b) =>
|
||||||
new Date(a) - new Date(b) || (!a ? -1 : !b ? 1 : 0)
|
new Date(a) - new Date(b) || (!a ? -1 : !b ? 1 : 0)
|
||||||
|
|
||||||
const createComparators = (criteria) => {
|
const createComparators = (criteria) =>
|
||||||
criteria.map(({ field, type, order = 1 }) => {
|
criteria.map(({ field, type, order = 1 }) => {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case String:
|
case String:
|
||||||
|
@ -18,10 +18,9 @@ const createComparators = (criteria) => {
|
||||||
case Date:
|
case Date:
|
||||||
return (a, b) => dateComparator(a[field], b[field]) * order
|
return (a, b) => dateComparator(a[field], b[field]) * order
|
||||||
default:
|
default:
|
||||||
return null
|
return (a, b) => 0
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
|
||||||
|
|
||||||
const characterIndex = (string = '') => {
|
const characterIndex = (string = '') => {
|
||||||
const value = string.charAt(0)
|
const value = string.charAt(0)
|
||||||
|
|
Loading…
Reference in New Issue