Modify string sorting to benefit upperCase (#2924)
* Modify the string sorting to benefit uppercase over lowercase at comparison
This commit is contained in:
1 parent
d93a0c170c
commit
389c635030
2 files changed
+50
-1
No files matched your search
@@ -10,7 +10,10 @@ const SORT_DIRECTION_ASCENDING = 'asc';
|
||||
const SORT_DIRECTION_DESCENDING = 'desc';
|
||||
|
||||
const sortFunctions = {
|
||||
string: (a, b) => String(a).localeCompare(String(b)),
|
||||
string: (a, b) =>
|
||||
String(a).localeCompare(String(b), navigator.language, {
|
||||
caseFirst: 'upper',
|
||||
}),
|
||||
date: (a, b) => new Date(a).getTime() - new Date(b).getTime(),
|
||||
number: (a, b) => Number(a) - Number(b),
|
||||
boolean: (a, b) => Number(a) - Number(b),
|
||||
|
||||
Reference in new issue
Block a user