Modify string sorting to benefit upperCase (#2924)

* Modify the string sorting to benefit uppercase over lowercase at comparison
This commit is contained in:
Carlos Alcaide Corvo authored and GitHub committed 2025-07-11 10:08:39 -07:00
1 parent d93a0c170c
commit 389c635030
2 files changed
+50 -1

No files matched your search

+4 -1
View File
@@ -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),